Skip to content

Add unit tests for MathObjects (Value.pm, Parser.pm, and subclasses). - #1495

Open
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:more-math-object-tests
Open

Add unit tests for MathObjects (Value.pm, Parser.pm, and subclasses).#1495
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:more-math-object-tests

Conversation

@drgrice1

Copy link
Copy Markdown
Member

Covers previously untested or thinly-tested classes: Complex, Vector, Point, Set, Union, String, AbsoluteValue, and Matrix linear algebra methods (det, inverse, trace, norms, solve, order, power), plus Parser.pm error paths for malformed expressions and differentiation of formulas with units.

Also fixes Value::Interval::D, Value::Set::D, and Value::Union::D in Differentiation.pm, which each had two extra leftover shift calls before my $self = shift, so $self was bound to the wrong argument (or undef) instead of the invocant, breaking the "can't differentiate" error methods. This is covered by the new differentiation.t tests.

I wrote the absolute_value.t and differentiation.t tests and fixed the issue in lib/Parser/Differentiation.pm a long time ago. I asked Claude to add some more unit tests for better MathObject test coverage. This is one of the things that AI is quite good at.

Covers previously untested or thinly-tested classes: Complex, Vector,
Point, Set, Union, String, AbsoluteValue, and Matrix linear algebra
methods (det, inverse, trace, norms, solve, order, power), plus
Parser.pm error paths for malformed expressions and differentiation of
formulas with units.

Also fixes Value::Interval::D, Value::Set::D, and Value::Union::D in
Differentiation.pm, which each had two extra leftover `shift` calls
before `my $self = shift`, so $self was bound to the wrong argument
(or undef) instead of the invocant, breaking the "can't differentiate"
error methods. This is covered by the new differentiation.t tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@somiaj somiaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests passed except for skipped rserv here (don't have that setup).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants