arturo-lang / arturo

Simple, expressive & portable programming language for efficient scripting
http://arturo-lang.io
MIT License
721 stars 32 forks source link

[lib\comparison\between] Test seems to be failing randomly #1740

Open github-actions[bot] opened 1 month ago

github-actions[bot] commented 1 month ago

We have to make sure the results are consistent and

re-enable the test

See also https://github\.com/arturo\-lang/arturo/issues/1667

limit: 100000000

loop permutate.repeated.by:3 numericTypes 'numericType [

middle: to numericType\[1] (random neg limit limit)

start: to numericType\[0] (random neg limit (dec middle))

end: to numericType\[2] (random (inc middle) limit)

impreciseOperation: or? ; skips floating-rational and rational-rational

and? (some? candidates \=> rational?) (some? candidates \=> floating?)

(every? candidates \=> rational?)

-> continue

]

]

https://github.com/arturo-lang/arturo/blob/1c6cee8a5d2b7fb976a4fc7ff1e2ee87e48c9f43/tests/unitt/lib/comparison/between.test.art#L44


suite "Test numeric-like values" [
    ; TODO(lib\comparison\between) Test seems to be failing randomly
    ;  We have to make sure the results are consistent and 
    ;  re-enable the test
    ;  See also https://github.com/arturo-lang/arturo/issues/1667
    ;  labels: unit-test, bug

    ; test.prop "start < middle < end, for deterministic operations"  [
    ;     limit: 100000000
    ;     loop permutate.repeated.by:3 numericTypes 'numericType [
    ;         middle: to numericType\[1] (random neg limit limit)
    ;         start:  to numericType\[0] (random neg limit (dec middle))
    ;         end:    to numericType\[2] (random (inc middle) limit)

    ;         candidates: @[middle start end]
    ;         impreciseOperation: or?  ; skips floating-rational and rational-rational
    ;             and? (some? candidates => rational?) (some? candidates => floating?)
    ;             (every? candidates => rational?)

    ;         if impreciseOperation
    ;             -> continue

    ;         assert -> between? middle start end
    ;     ]
    ; ]

    test "start < middle < end, for :rational and :floating" [
        assert -> between? 3:2 1:1 2:1 ; :rational :rational :rational