aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-05 20:32:43 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-05 21:06:05 -0400
commit89e5cd6474486c4a2de14e05b85779aa3c24e648 (patch)
treee8ac50394985a0ca465557d557549eaeca462ee0 /test
parent7d24a3eb4fb42d44dcd3e0c1812125a417ee3f48 (diff)
Tests for literal handling
Diffstat (limited to 'test')
-rw-r--r--test/cases/literal.bqn59
-rw-r--r--test/cases/syntax.bqn1
2 files changed, 59 insertions, 1 deletions
diff --git a/test/cases/literal.bqn b/test/cases/literal.bqn
new file mode 100644
index 00000000..c3114957
--- /dev/null
+++ b/test/cases/literal.bqn
@@ -0,0 +1,59 @@
+# Numbers
+0 % 0
+0 % 0e¯7
+0 % 0e0
+0 % 0e99
+12 % 12
+12 % 12e0
+12 % 1.2e1
+12 % 12_
+123 % 12_3
+1.23 ≡ 1_.2_3
+! % _12
+-12 % ¯12
+-12 % ¯12.0
+-12 % ¯1.2e1
+-10 % ¯1e1
+-12 % ¯120e¯1
+! % 5.
+! % .5
+! % _.5
+! % .12e2
+! % ¯
+! % 4¯2
+! % ¯e¯
+! % 2e
+! % 2.e
+! % 2.e0
+! % 1y2
+! % 1_y_2
+
+# π and ∞
+¯∞ ≡ -∞
+π ≡ π__
+πe4 ≡ π×1e4
+! % 1eπ
+! % 1e¯∞
+! % 2∞
+! % π2
+! % 4.∞
+! % π.4
+! % _∞
+
+# Characters
+32 % ' '-@
+34 % '"'-@
+39 % '''-@
+120169 % '𝕩'-@
+! % 'ab'
+! % 'ab'
+! % ''
+! % 'a
+! % '
+
+# Strings
+'a'‿'b' ≡ "ab"
+"abcdef" ≡ 'a'+↕6
+9 % ≠"a""""b''""c'"
+"\n\\n\\\n" ≡ 1‿0‿1‿1‿0‿1‿1‿1‿0⊏"n\"
+↓∘⊑⊸≡ """"‿""
diff --git a/test/cases/syntax.bqn b/test/cases/syntax.bqn
index 8ea85353..4248b49d 100644
--- a/test/cases/syntax.bqn
+++ b/test/cases/syntax.bqn
@@ -41,7 +41,6 @@
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
-9 % ≠"a""""b''""c'"
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