1.#INF comparisons fail, but match in the console. e.g. >> strict-equal? 1.#INF 1.7976931348623157e+308% - -1.7976931348623157e+308% == false >> equal? 1.#INF 1.7976931348623157e+308% - -1.7976931348623157e+308% == false >> equal? 1.#INF 1.7976931348623157e+310% - -1.7976931348623157e+310% == true >> strict-equal? 1.#INF 1.7976931348623157e+310% - -1.7976931348623157e+310% == false >> 1.7976931348623157e+310% - -1.7976931348623157e+310% == 1.#INF >> 1.7976931348623157e+308% - -1.7976931348623157e+308% == 1.#INF
percent!values. It seems unnatural, I've never seen a percent written using scientific notation.
even?/odd? on time values (PR fixed), we have tb4-t: -1:-0:-0 in the tests, but that seems to be invalid syntax now. Invalid integer thrown. Should we remove that, or is it a regression?>> tb3-t: 2147483645:59:59 == 2147483645:59:58.9997406
even?/odd? PR for negative times too.round, but trying that real quick I'm missing something fundamental in R/S:even?: func [ tm [red-time!] return: [logic!] /local t [float!] ][ tm: round tm 1.0 no yes no no no no ; yes is down? slot t: tm/time not as-logic (as integer! GET_SECONDS(t)) and 1 ]
*** Compilation Error: argument type mismatch on calling: red/time/round
*** expected: [struct! [
header [integer!]
padding [integer!]
value [float!]
]], found: [float!]Red/System use Red/System data structures? Unless it requires (un)boxing or other conversionspower-test.red$ red interp-power-test.red
~~~started test~~~ interp-power ~~~finished test~~~ interp-power Number of Tests Performed: 10 Number of Assertions Performed: 12 Number of Assertions Passed: 12 Number of Assertions Failed: 0
rebol -qws run-all.r —batch, two error in quik-test.log ===group=== power error --test-- power-error-2 FAILED************** --test-- power-error-2 FAILED**************
Write tests for functions in environment/function.red in trello test board, there has no test code for environment/function.red, I plan to do this, is that ok?--test-- "series-find-76" hs-fd-1: make hash! [2 3 5 test #"A" a/b 5 "tesT"] append hs-fd-1 datatype! --assert 3 = index? find hs-fd-1 5
git blame to retrieve the author of this test.functions.red, how to write test for quit funcquit: func [ "Stops evaluation and exits the program" /return status [integer!] "Return an exit status" ][ #if config/OS <> 'Windows [ if system/console [system/console/terminate] ] quit-return any [status 0] ]
?? func??: func [ "Prints a word and the value it refers to (molded)" 'value [word! path!] ][ prin mold :value prin ": " print either value? :value [mold get/any :value]["unset!"] ]
stander output quit you need to "stub out" quit-return. Something like this:--test "quit-1"
save-quit-return: :quit-return
quit-return: func [/return status][any [status 0]
--assert 0 = quit
quit-return: :save-quit-returncall/output “red [] quit 2” out , seems no use--test "??-1"
save-print: \:print
save-prin: \:prin
??output: copy ""
print: function[val][append ??output reduce value]
??-1-a: 1
?? ??-1-a
--assert none <> find ??output "??-1-a: 1"
print: \:save-print
prin: \:save-prin#if config/OS <> 'Windows [
if system/console [system/console/terminate]
]quit will be difficult at this stage. call later.context: func [spec [block!]][make object! spec]
make object! so o: context [a: 1 b: 2] is the same as o: make object! [a: 1 b: 2].context correctly makes an object. Something like this:--test-- "context-1"
c1-c: context [a: 1 b: "345" f: function []["Okay"]]
--assert c1-c/a = 1
--assert c1-c/b = "345"
--assert "Okay" = c1-c/f
--assert Object! = type? c1-cenvrionment/functions.red has already completed, but I do not know how to run it, I add ../environment/functions-test.red into tests/source/units/all-tests.txt, then run command $ rebol -s run-all.r, got some error:** Access Error: Cannot open /Users/ma/puffin/red.git/tests/source/units/auto-tests/interp-../environment/functions-test.red ** Where: write-test-header ** Near: write file-out tests
tests/source/units/auto-tests/functions-test.red, run-all.r, found real action in tests/source/units/run-all-init.r;; make auto files if needed do %make-red-auto-tests.r do %make-interpreter-auto-tests.r ;; build run-all-comp.red and run-all-interp.red do %make-run-all-red.r ;; build the each test runners do %make-run-each-runner.r
make-interpreter-auto-tests.r, seems generate lots of files under the directory auto-testsmake-interpreter-auto-tests.r can currently only handle files in `tests/source/units' or sub-directory of it. I will need to take a look at it to work out how to handle files in other dirs. ...using libRedRT built on 13-Oct-2017/16:05:50+8:00 *** Compilation Error: a routine must have a name *** near: [routine [1] [2]]
rt-1: try [routine [1] [2]] --assert error? rt-1
routine: func [spec [block!] body [block!]][ cause-error 'internal 'routines [] ]
make-interpreter-auto-tests.r and make-run-all-red.r, they generate so many files in auto-tests and auto-tests/run-all folders, a little complexroutine-test.red, so I just delete routine test in my functions-test.redTry seems to be the issue, though your spec block isn't valid either. If you put the try around it (try [rt-1: routine [a] [a]]), you get:...using libRedRT built on 16-Oct-2017/11:33:11-6:00
*** Compilation Error: declaring a function at this level is not allowed
*** near: [
rt-1: func [a] [a]
stack/mark-native ~set
word/push ~rt-1
]try will hide the actual error here.===group=== fifth tests --test-- fifth-3 FAILED************** ~~~finished test~~~ run-all-interp Number of Tests Performed: 5531 Number of Assertions Performed: 9633 Number of Assertions Passed: 9632 Number of Assertions Failed: 1 ****************TEST FAILURES****************
--test-- "fifth-3" --assert 5 = fifth 1.2.3.4.5run-all-comp1 and run-all-interp?fifth-3 test successed in run-all-comp1, but failed when run run-all-interprun-all-comp1 and run-all-comp2 contain all the compiled tests.run-all-interp contains all the tests compiled but to run using the interpreter rather than compiled code.--test-- "fifth-3" --assert 5 = fifth 1.2.3.4.5 - I checked against the latest master and this should work. The most likely reason for this failing is that fifth has been set in another test.run-all.r, we need them to work in build-arm-tests.r.quick-test.red and quick-test.reds seem to work very well. We need to completely overhaul "test running" though.