Arithmetic Test Cases01 Aug 2015 GSoC-2015 · SymEngine
Hey there! This week I implemented the suggestions given after the first round of review for PR#487 and I tried to port the test cases in
arit_spec.rb. It was worth it! The unit tests that I had written for the individual classes were not enough and didn’t cover every situation where an error might occur. Many test cases failed, indicating I had failed to include a corner case. After finding and fixing them, most of the cases passed except a few. They are
......FF.............................. Failures: 1) Arithmetic test cases test_arit7 Failure/Error: assert 2 * x - x == x TypeError: wrong argument type Fixnum (expected Class) # ./spec/arit_spec.rb:80:in `-' # ./spec/arit_spec.rb:80:in `block (2 levels) in <top (required)>' 2) Arithmetic test cases test_arit8 Failure/Error: assert x**2 / x == x TypeError: wrong argument type Fixnum (expected Class) # ./spec/arit_spec.rb:94:in `/' # ./spec/arit_spec.rb:94:in `block (2 levels) in <top (required)>' Finished in 0.01956 seconds (files took 0.10097 seconds to load) 38 examples, 2 failures Failed examples: rspec ./spec/arit_spec.rb:75 # Arithmetic test cases test_arit7 rspec ./spec/arit_spec.rb:86 # Arithmetic test cases test_arit8
The error messages show that the argument type to
Fixnum. And the error messages don’t even make sense. It can be clearly seen that the operand to
SymEngine::Symbols. I had even tried printing them out, just to be double sure. I am not able to figure out what might be the reason. Any help will be really appreciated.
And there are still a few bugs in
sympify, the function that takes a ruby object and returns the corresponding C structure for the type.
I know I again failed my this weeks target. There are just too many tests these companies(they are in our university to select interns) are taking and there are assignments on top of that. I did what I could.
My next week’s target is to document everything I have done so far, including the beginner contributor guide. I know the pain of going through undocumented code, and I don’t want to turn away someone interested who has come to read my code.
And it is obvious that the problems faced in getting the PR#487, will be resolved by then, and sent for feedback. I am yet to confirm if we will be hosting the gem on RubyGems.org by then.
- Moved module and class declarations to
- Removed modifications of
- Added method
- Implemented class coercion.
Rationalcan now be coerced into SymEngine classes
- Updated test for large number
- Added coercion tests for
- Added coercion tests for
- Used sympify in
arit_spec.rb, rspec equivalent of
comments powered by Disqus