summaryrefslogtreecommitdiffstats
path: root/tests/016
Commit message (Collapse)AuthorAgeFilesLines
* bracket: bug: wrong result when function is applied.Kaz Kylheku2019-09-101-0/+14
| | | | | | | | | | | | Reported by user vapnik spaknik. * lib.c (bracket): Don't rely on the index variable to step through the arguments, because it only counts fixed arguments. The args_get function doesn't increment the index beyond args->fill; when popping arguments from args->list, index stays unmodified. * tests/016/arith.tl: Tests for bracket added.
* tests: add tests for digits function.Kaz Kylheku2019-09-091-0/+18
| | | | * tests/016/arith.tl: Add various digits tests.
* u-d-arithmetic: proper treatment of ceil & round.Kaz Kylheku2019-03-301-2/+10
| | | | | | | | | | | | | | | * arith.c (r_ceil_s, r_round_s): New symbol variables. (ceildiv, roundiv): Route binary cases involving struts directly to binary methods so the object is responsible for the complete implementation. (arith_init): Initialize r_ceil_s and r_round_s. * tests/016/ud-arith.tl (numbase): Binary methods added for ceil and round. Test cases added. * txr.1: Descriptions for binary ceil and round methods added; Notes about non-existence of binary methods removed from unary ceil and round removed.
* Tests for user-defined arithmetic and fixes.Kaz Kylheku2019-03-302-0/+132
| | | | | | | | | | | | | | | | | | | | | | | * tests/016/ud-arith.expected b/tests/016/ud-arith.tl: New file. * tests/016/ud-arith.expected b/tests/016/ud-arith.expected: New file. * arith.c (divi): Bugfix: wrong argument tested for being a COBJ. (logtrunc): Fix incorrect method call: calling r-logtrunc-s for the object-in-left-position case. (sign_extend): Fix semantics not following documentation: dispatch method with original arguments. (divv): When there is just one argument, take advantage of the hitherto unused unary case of divi rather than giving it both arguments. The object dispatch is in that unary case, so we need it now. (arith_init): Fix wrong name of r_lognot_s symbol. * txr.1: Fix atan2 being documented as atan. Fix misspelling of r-lognot as lognot-r.
* New arithmetic tests.Kaz Kylheku2016-11-152-0/+41
* Makefile (TXR_DBG_OPTS): Suppress for new directory tests/016. * tests/016/arith.tl: New file. * tests/016/arith.expected: New file.