-
-
Notifications
You must be signed in to change notification settings - Fork 81
Migrate test suite to Test2 #692
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
Conversation
Resolve problem with space after function to a power. (openwebwork#598)
Co-authored-by: Davide P. Cervone <dpvc33@gmail.com>
…tion-parens Fix calls to Parser::Value::TeX & too many (cooks)
…signment parserAssignment chokes when previous answer is undefined on the domain
…in PGML via `[:: ::]` now fail to parse.
…t-parsing Fix an issue with parserAssignment.pl introduced in openwebwork#609
If a problem sets the answer to be a formula with an assigment,
(something like `Formula("x = 5")` then all answers are counted
incorrect and a warning is displayed that the evaluated answer is not an
answer hash. This worked prior to openwebwork#609. The cause of this was the
removal of a line that should not have been removed that converts the
other answer being compared to to a Formula if it is not already.
Note that the original issue that was attempted to be fixed by openwebwork#609
still is fixed with this change.
This fixes issue openwebwork#644 that I just submitted about this.
…ession Fix another regression caused by openwebwork#609.
Update the copyright in files and version bump.
There was an indexing error in the logic of the tab focus handler of the selection tool that results in the last defining point of an object that has three or more defining points not working correctly. To see the issue, graph any object and then graph a quadratic or cubic after that. Immediately after completing the graph of the quadratic or cubic hit shift-tab. With the code in the release candidate branch the focus will jump back to the last point on first object that was graphed. With this pull request the focus will go to the next to last point on the quadratic or cubic as it should.
…us-order Fix tab order for the three point quadratic and four point cubic tools.
Curently the center point of a circle can not be focused by clicking on it with the mouse. This is because the jsxgraph circle hasPoint method only returns true if the circle itself contains the given point, but not if the center point contains the given point. So redefine the hasPoint method for a circle to fix that.
…ter-focus Fix pointer focus for the center of a circle.
still be a final result from the AnswerHints postfilter.
called by AnswerHints dies.
as that would be the result of the calculation used for any such n due to overflow of the Perl floating point data type.
…2 gateway quizzes.
…K and PG 2.16. It seems that Safari does not properly honor the specifications for the FocusEvent.RelatedTarget, and the new method does not work for that lame browser (at least the current version).
* Added a test for the factorial. * FIX: clarified some of the language in the tests.
Limit loop to compute factorial to n<=170, for n>170 return Perl Inf
Minor changes to migrate tests in t/context from Test::More to Test2 There were few tests in these files. toltype_digits.t organized into subtests by topic
|
Overall, the switch over to Test2 seems to be the right way to go and this branch is a good start to doing so. I got the t/units/basic_module.t to succeed with |
Patch AnswerHints
This expands on the original t/README.md on the details of testing. It replaces the earlier commit in this branch where it was accidentally replaced with the top level README (or something)
Three test files migrated from Test::More to Test2 without modification (other than moving the environment setup from the script to Test::PG)
Convert `throws_ok` to the like/dies construct and the tests pass. Arranged sections in subtests
PITA! The circular references in MathObjects made the deep comparisons impossible, so all MathObjects were stringified for comparisons. WARN and DEBUG message sub redefinitions were removed. A "validator" and a stringify sub were added to get around some of the comparison issues. Organized into subtests. Needs cleanup, but everything passes.
Cleanup of code layout to make the file look half-decent Needs another pair of eyes to make it sensible. I'm just tired of it now.
|
@pstaabp All the test files have been migrated to Test2. Of them all, t/macros/tableau.t was the most problematic because of the circular references in MathObjects prevent the deep comparisons. Most of the tests are the same, except for a lot of t/macros/math_objects_basics.t has examples of migrating Once #690 has been merged into PG-2.17, I'll remove the version checking code from t/units/electron_volts.t |
…ols. When graphing a parabola (via any of the tools that do so) or a cubic it is possible to create degenerate objects. The code that is supposed to prevent that wasn't quite working right. The jsxgraph board object needs to be updated after setting the position of a point programatically. To test this graph any of those objects and then move one of the defining points of the object around with the keyboard. For example, graph a three point quadratic and try to move one point onto the same vertical line as another point. That should not be possible.
Correct value for electron volt in Units.pm
…ates Fix the prevention of creating degenerate objects with keyboard contols.
…lbar-focus-hack Revert to the mqeditor toolbar focus hack previously used with WeBWorK and PG 2.16.
Fix ww3 mq-editor preview button code causing console log error in ww2 gateway quizzes.
…roblems. This removes the font size and from these elements. It also removes the font-family that was set on selects. The font family still applies to textreas and text inputs.
Only use \textstyle formating option in a fraction's TeX output for mixed numbers. For other cases don't include this to allow the size of the fraction to be formatted according to \displaystyle.
In contextFraction only use \textstyle for mixed numbers.
For PTX output, don't include hidden MathQuill inputs
Tweak the styles for labels, text inputs, selects, and textareas in problems.
This fixes issue openwebwork/webwork2#1739. In the PG problem editor, the page in the iframe is not displayed until after the page loads. As such the javascript getComputedStyle method fails. The same things happens with the graphtool. The same solution is now implemented for knowls.
Make knowls wait until the page css has loaded before initializing.
This is a Work In Progress to show how the PG test suite would look if it were migrated to Test2. @pstaabp asks for a reason to justify the move and I think the clearest way of talking about the issues is to have a diff we can all refer to.
This starts out with the tests for Units.pm which started the conversation. It uses my preferred style of a Test module in t/lib/ to set the environment and updates the README.md
The test for contextTrigDegrees.pl exposed some existing errors either in how the macro was being loaded or how the module runs. Comments have been left and failing tests wrapped in a TODO block.
More migrated tests will be added to this PR as I find the time.