Skip to content
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

Modified Test Expectations #1311

Merged
merged 4 commits into from
Nov 11, 2024
Merged

Modified Test Expectations #1311

merged 4 commits into from
Nov 11, 2024

Conversation

Sonu0305
Copy link
Contributor

Pull Request: Resolve Issue #1309

This pull request addresses and resolves issue #1309 by modifying test expectations in intersect.m to handle empty input cases correctly.

Description of Changes

The approach was to adjust the expected output for a specific test case that was previously failing due to handling symbolic arrays intersected with an empty set.

Code Before

%!test
%! % empty input
%! A = sym([1 2]);
%! C = intersect(A, []);
%! assert (isequal (C, sym([])))

Code After

%!test
%! % empty input
%! A = sym([1 2]);
%! C = intersect(A, []);
%! assert (isequal (size(C), [1, 0]))

In this update, the assertion now checks that C has a size of [1, 0], aligning with the expected behavior for symbolic arrays when intersected with an empty set.

Test Results

After making these changes, all tests for intersect.m have successfully passed, confirming the issue has been resolved:

image

@cbm755 , could you please review this PR when you have a chance? Thank you for your time!

@@ -98,7 +98,7 @@
%! % empty input
%! A = sym([1 2]);
%! C = intersect(A, []);
%! assert (isequal (C, sym([])))
%! assert (isequal (size(C), [1, 0]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would assert (isempty (C)) work?

Copy link
Collaborator

Choose a reason for hiding this comment

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

(advantage is test would pass on both new and old sympy)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would assert (isempty (C)) work?

Yes, this too is likely to work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, please make that change too then and we'll get this merged.

@cbm755
Copy link
Collaborator

cbm755 commented Nov 10, 2024

Please add your name to the copyright header at the top of intersect.m.

@Sonu0305
Copy link
Contributor Author

Please add your name to the copyright header at the top of intersect.m.

yes noted, I added my name to the copyright header.
@cbm755

@@ -98,7 +98,7 @@
%! % empty input
%! A = sym([1 2]);
%! C = intersect(A, []);
%! assert (isequal (C, sym([])))
%! assert (isequal (size(C), [1, 0]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, please make that change too then and we'll get this merged.

@Sonu0305
Copy link
Contributor Author

@cbm755
Made the necessary changes, Thank You!

@Sonu0305 Sonu0305 requested a review from cbm755 November 11, 2024 13:06
@cbm755
Copy link
Collaborator

cbm755 commented Nov 11, 2024

Thanks for this.

CI failures are #1312, unrelated to this PR.

@cbm755 cbm755 merged commit e0761bf into gnu-octave:main Nov 11, 2024
21 of 29 checks passed
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