-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Squiggle: Date, Duration, Number units needs unit tests #665
Comments
Here's the PR! #2370.⚡ Sweep Basic Tier: I'm creating this ticket using GPT-4. You have 5 GPT-4 tickets left for the month and 3 for the day. For more GPT-4 tickets, visit our payment portal.
Actions (click)
Install Sweep Configs: Pull Request
Step 1: 🔎 SearchingI found the following snippets in your repository. I will now analyze these snippets and come up with a plan. Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.squiggle/packages/squiggle-lang/__tests__/dist/Invariants/AlgebraicCombination_test.ts Lines 1 to 45 in 13b14b8
squiggle/packages/squiggle-lang/src/utility/DateTime.ts Lines 1 to 89 in 13b14b8
squiggle/packages/squiggle-lang/__tests__/reducer/various_test.ts Lines 70 to 145 in 13b14b8
squiggle/packages/squiggle-lang/__tests__/SqProject/SqProject_tutorial_2_multisource_test.ts Lines 5 to 88 in 13b14b8
squiggle/packages/squiggle-lang/__tests__/ast/parse_test.ts Lines 434 to 495 in 13b14b8
Step 2: ⌨️ Coding
Create packages/squiggle-lang/__tests__/utility/DateTime_test.ts with contents:
Create packages/squiggle-lang/__tests__/utility/DateTime_test.ts with contents: This file will contain unit tests for the DateTime utility. It will import the Duration, DateModule, and Date entities from the DateTime utility file.
Create packages/squiggle-lang/__tests__/utility/DateTime_test.ts with contents: This file will contain the test cases for the DateTime utility. It will import the Duration and DateModule from the DateTime utility file. It will also import the expect function from the jest globals.
Create packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts with contents:
Create packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts with contents: The new test file should import the NumberUnits utility from the relevant file. It should contain a series of tests that cover all the methods in the NumberUnits utility.
Create packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts with contents: This file will contain unit tests for the NumberUnits utility. It will import the NumberUnits utility from the relevant file and use Jest for testing. The tests will cover typical use cases, boundary values, and invalid inputs. Each test will create a NumberUnits instance from a float, and then check the float and string representations of the instance. The invalid inputs test will check that creating a NumberUnits instance from NaN, Infinity, and -Infinity throws an error.
Create packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts with contents: The "NumberUnits_test.ts" file should be created in the "packages/squiggle-lang/__tests__/utility/" directory. This file will contain unit tests for the "NumberUnits" utility.
Run packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts through the sandbox.
Step 3: 🔁 Code ReviewI have finished reviewing the code for completeness. I did not find errors for 🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. |
Unit tests are nice but this task is too old to be meaningful. Note that in many cases we run |
Units are evaluated but there are no unit tests. Test coverage is 0
Checklist
packages/squiggle-lang/__tests__/utility/DateTime_test.ts
✓ f91ef19packages/squiggle-lang/__tests__/utility/DateTime_test.ts
✗packages/squiggle-lang/__tests__/utility/DateTime_test.ts
⋯packages/squiggle-lang/__tests__/utility/DateTime_test.ts
✗packages/squiggle-lang/__tests__/utility/DateTime_test.ts
⋯packages/squiggle-lang/__tests__/utility/DateTime_test.ts
✗packages/squiggle-lang/__tests__/utility/DateTime_test.ts
✗packages/squiggle-lang/__tests__/utility/DateTime_test.ts
✗packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
✓ e0d6065packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
✗packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
⋯packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
✗packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
⋯packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
✗packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
⋯packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
▶packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
▶packages/squiggle-lang/__tests__/utility/NumberUnits_test.ts
▶The text was updated successfully, but these errors were encountered: