uCBQN/test/equal.bqn
2022-04-02 20:00:34 +03:00

46 lines
1.3 KiB
BQN
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ListVariations, ClearRefs, Variation, Squeeze, Info •internal
u •UnixTime@
# u ↩ 1648896733
r •MakeRand •Show u
TestVars { w𝕊ab:
n ¬w
(ListVariations a) {
¬n (𝕨 Variation a) (𝕩 Variation b)? @;
•Out "fail for "𝕨"/"𝕩", expected "(w"0""1")":"
•Out •Repr a
•Out •Repr b
•Out •Repr ab
•Exit 1
} ListVariations b
ClearRefs@
}
(1 TestVars ˜)¨ "" 0
# types: u1,i8,i16,i32,f64,c8,c16,c32
szs 2(281632)0(2816)1114111
off 0(271531)¯0.5000
chr 00000111
specF64 - ÷0 10
RandVal {
𝕩4? {specF64˜𝕩 r.Range specF64}((0=𝕨 r.Range 2r.Range 10)/) 𝕨 r.Range 0;
Squeeze @+(𝕩chr) (𝕨 r.Range 𝕩szs) - 𝕩off
}
Do { 𝕊:
at r.Range 8
l 1 + r.Range (at=0)100700
a l RandVal at
(1{𝕊:´a=a} at=4) TestVars aa
{ 𝕊:
p r.Range l
v 1 RandVal r.Range5 5+r.Range3 at5
exp v = pa
b Squeeze v(p) a
(exp{𝕊:´a=b} at=4) TestVars ab
}100 @
}
@Do1000 @