aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-05 21:39:37 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-05 21:39:37 -0400
commit5f4c18885f6e2445d2f1034a73be1213f45a092c (patch)
tree64871a448b932a481c6878a56f8456a789d327fc
parentd02a1bc55e70e238994fe5d98183cdc56a7221ee (diff)
Organize syntax tests somewhat
-rw-r--r--test/cases/syntax.bqn42
1 files changed, 28 insertions, 14 deletions
diff --git a/test/cases/syntax.bqn b/test/cases/syntax.bqn
index 4248b49d..b32fa555 100644
--- a/test/cases/syntax.bqn
+++ b/test/cases/syntax.bqn
@@ -1,31 +1,46 @@
+# Expressions
-4 % (⌈-)4+÷2
3 % √5(+×-)4
1 % 4((¬=)∧¬=1+-)6
+9 % ט-3
+1 % 3-˜4
+0.25 % 4-˜○÷2
+3 % √5-○(ט)4
+
+# Assignment
5 % F←-⋄2+3
-3 % F←-⋄F 3
3 % DiffSq←+×((-))⋄√5 DiffSq 4
3 % F←-⌊⋄2 F-3
3 % a←3,2 A 4
--2 % F←G←-⋄G↩+⋄h←0⊑f≍g⋄H 2
-9 % ט-3
-1 % 3-˜4
-0.25 % 4-˜○÷2
-3 % √5-○(ט)4
8 % _m←˜⋄+_m 4
8 % _c_←⊸ , 4 _c_ × 2
+16 % 3(2×+⍟(1+1))2
+5 % 2+⍟3-1
+
+# Modify
+-2 % F←G←-⋄G↩+⋄h←0⊑f≍g⋄H 2
+2 % c‿d←2+⟨a,b⟩←↕2⋄⟨b‿c,a⟩↩⟨4⋄5⟩‿6⋄(b×c)-d×a
+3 % x←4⋄x-↩1⋄x
+5 % x←2⋄x-˜↩7⋄x
+2 % a‿b←2‿0⋄a‿b+↩2⋄a÷b
+-7 % x‿y←3‿4⋄x+⍟2˜↩2⋄Y↩-⋄Y x
+
+# Lists
1 % (↕2)≡⟨0,1⟩
1 % (↕2)≡⟨⋄0,⋄1⋄⋄⟩
1 % l←⟨2×3⋄5⟩⋄-´l
1 % -´⟨2×3⋄5⟩
2 % (4-⟨0,1⟩×2)⊑˜1
-16 % 3(2×+⍟(1+1))2
-1 % f←0⊑⟨×,-⟩⋄F 2 F -4
+0 % ≠⟨⟩
+1 % ⟨⟩≡0↑1‿2
3 % ≠0‿1‿2
2 % 0⊑2‿+‿-‿1
30 % ×´(2‿(1+3)‿(×4))+1
1 % f←2⊑(ט)‿⍟‿(×-+)⋄2 F 3
-0 % ≠⟨⟩
-1 % ⟨⟩≡0↑1‿2
+
+# Blocks
1 % {𝕩-1}2
4 % ({𝕩×𝕩})2
3 % 2{𝕩÷𝕨}6
@@ -33,17 +48,16 @@
-1 % (⊑⟨×⟩){𝔽}¯2
4 % (⊑⟨×⟩){𝕩𝔽𝕩}¯2
6 % +´(ט)‿-{𝕎𝕩}¨3
-5 % 2+⍟3-1
9 % _m←˜⋄{mm←𝕩⋄×_mm 3}m
-2 % F←{-𝕩}⋄{F 2}
-2 % c‿d←2+⟨a,b⟩←↕2⋄⟨b‿c,a⟩↩⟨4⋄5⟩‿6⋄(b×c)-d×a
-3 % x←4⋄x-↩1⋄x
-5 % x←2⋄x-˜↩7⋄x
-2 % a‿b←2‿0⋄a‿b+↩2⋄a÷b
--7 % x‿y←3‿4⋄x+⍟2˜↩2⋄Y↩-⋄Y x
+# 2 % 1{𝕣,𝕩}2
+
+# Exports
2 % ⟨a⟩←{a⇐b⇐2⋄3}⋄a
6 % r‿q←{q‿r⇐⋄q←1+r←2}⋄r×q
4 % c←0⋄⟨a,b⟩←{b⇐1⋄a⇐2}⋄⟨b,c⟩↩{a‿b‿c⇐3+↕3}⋄b
10 % r‿s←{r‿q←{q⇐1+r⇐2}⋄s⇐5⋄r⇐}⋄r×s
+
+# Nothing
-4 % (1+·)-4
1 % ·⋄1