- 
                Notifications
    You must be signed in to change notification settings 
- Fork 120
Comprehensive jsnum tests #1818
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
          
     Open
      
      
            ds26gte
  wants to merge
  59
  commits into
  brownplt:horizon
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
ds26gte:jsnum-tests
  
      
      
   
  
    
  
  
  
 
  
      
    base: horizon
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 1 commit
      Commits
    
    
            Show all changes
          
          
            59 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      f3a3930
              
                Added tests/jsnum-test.js to test methods in js-numbers.js that aren'…
              
              
                ds26gte b414392
              
                Merge branch 'fromFixnum-fix' into jsnum-tests
              
              
                ds26gte a6485eb
              
                - jsnums-test.js: enhance #1812
              
              
                ds26gte 812e409
              
                fromString(): Rational.makeInstance already takes care of den == 1
              
              
                ds26gte a1837be
              
                - makeNumericBinop tests
              
              
                ds26gte f2d40dd
              
                jsnums-tests.js: Add tests for Rational methods
              
              
                ds26gte b8442a2
              
                - more Rational.* tests
              
              
                ds26gte 6e0e0ef
              
                scrub unnecessary defs from jsnums-test.js
              
              
                ds26gte 74efc26
              
                add Roughnum.* tests
              
              
                ds26gte bc4f135
              
                - add arrayEquals to help test structural equality
              
              
                ds26gte 6beef5f
              
                - numerator, denominator methods take errbacks param
              
              
                ds26gte 66122ae
              
                Merge branch 'horizon' into jsnum-tests
              
              
                ds26gte cc52770
              
                jsnums-test.js: add test for gcd, lcm
              
              
                ds26gte cb4e69e
              
                - add tests for number predicates, sign, zfill, liftFixnumInteger
              
              
                ds26gte 1b7a85e
              
                add tests for number casts
              
              
                ds26gte e791660
              
                - add tests for nthRoot() and integerNthRoot() #1812
              
              
                ds26gte 8c85b1f
              
                - BigInteger canonicalizer bnpClamp()  #1823
              
              
                ds26gte 74b589c
              
                - test that bignums indeed have unique representations
              
              
                ds26gte 8d75cd8
              
                tests for
              
              
                ds26gte 3b9cad4
              
                - test BigInteger's {copy,sub,multiply,{d,}{l,r}Shift}To
              
              
                ds26gte cb5b948
              
                test for bnp{Squareto,DivRemTo,Exp,IsEven,ModInt}
              
              
                ds26gte 15914a9
              
                - makeInteger{UnOp,Binop}: use & propagate errbacks appropriately
              
              
                ds26gte 09a47af
              
                test bnpToRadix
              
              
                ds26gte d727abd
              
                - ensure all calls to equals(), lessThan{,OrEqual}() take errbacks
              
              
                ds26gte 0bdd499
              
                test toRepeatingDecimal() for non-valid args
              
              
                ds26gte 00b90b9
              
                - add num-gcd courtesy @blerner #1427
              
              
                ds26gte d3d00ad
              
                remove all (commented)  debugging console.log's
              
              
                ds26gte 1ec7a95
              
                jsnums-test.js: Add test for toRepeatingDecimal() mistakenly called with
              
              
                ds26gte 7b63e0f
              
                - lift def of getReside() up from toRepeatingDecimal()
              
              
                ds26gte 2a22911
              
                simplify toRepeatingDecimal(). Now that getResidue() is out,
              
              
                ds26gte d58e838
              
                jsnums-test.js: test toRepeatingDecimal errors, with and without corr…
              
              
                ds26gte 298e87c
              
                Following's defs & calls need explicit errbacks propagration:
              
              
                ds26gte b952582
              
                Following defined but unused -- identify for now, potentially remove …
              
              
                ds26gte e962b78
              
                Don't α-rename potential unusued functions
              
              
                ds26gte e29c32b
              
                `make test` should run tests/jsnums-test/jsnums-test.js
              
              
                ds26gte 486dd9c
              
                arrayEquals() not needed in jsnums-test.js
              
              
                ds26gte 3c0f18f
              
                function and method isInteger() call should take errbacks
              
              
                ds26gte 66d11d2
              
                - Ensure function and method toFixnum() calls take errbacks
              
              
                ds26gte 1e5c790
              
                Merge branch 'horizon' into jsnum-tests
              
              
                ds26gte b8e6c6f
              
                add tests that liftFixnumInteger on non-int fixnum produces valid rat…
              
              
                ds26gte 0ddee45
              
                - {Rational,BigInteger}.log() should take advantage of log() instead of
              
              
                ds26gte d489ce1
              
                add errbacks to stray add multiply subtract expt
              
              
                ds26gte f2663ca
              
                ensure negate() gets an errbacks arg
              
              
                ds26gte 4e104da
              
                ensure floor() calls get errbacks
              
              
                ds26gte 8606db2
              
                ensure numerator() calls get errbacks
              
              
                ds26gte 70a7be6
              
                ensure abs() sign() sqrt() get errbacks arg
              
              
                ds26gte 2b840c3
              
                ensure liftFixnumInteger() calls get errbacks arg
              
              
                ds26gte 551610f
              
                - isInteger() - don't take errbacks as it's standard JS!
              
              
                ds26gte 79314f8
              
                - define InternalCompilerErrorErrbacks for errbaks that shouldn't be …
              
              
                ds26gte 3c6f202
              
                - Function toRational() doesn't take errbacks but passes InternalComp…
              
              
                ds26gte 605dee2
              
                Function toRoughnum() doesn't take errbacks but passes InternalCompil…
              
              
                ds26gte fbbccc3
              
                throwInternalCompilerError() uses throw new Error()
              
              
                ds26gte a95a176
              
                - toFixnum() -- check if arg is (box)number before trying method
              
              
                ds26gte 94d209d
              
                - remove errbacks param from: bnpExp bnModPowInt bnPow bnModInverse
              
              
                ds26gte 671d80e
              
                No errbacks param for: abs equalsAnyZero floor ceiling round roundEven
              
              
                ds26gte 38b91c6
              
                Simplify defs of {greater,less}Than{,OrEqual}
              
              
                ds26gte 89c8c37
              
                Ensure sqr() calls take errbacks
              
              
                ds26gte 0fac202
              
                BitInteger.prototype.sqrt def doesn't need to be wrapped in an IIFE
              
              
                ds26gte 190468d
              
                Revert "Simplify defs of {greater,less}Than{,OrEqual}"
              
              
                ds26gte File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ds26gte why are these commented out? We should be testing to make sure they fail, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that they should not fail, but were. I kept them around so I could solve the underlying problem as to why they were failing.
Now that I've canonicalized bigint representation -- i.e, every bigint now has a only one representation, not multiple as before --, these tests no longer fail, and are now uncommented.