aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/bytes.tm4
-rw-r--r--test/inline_c.tm2
-rw-r--r--test/integers.tm18
-rw-r--r--test/moments.tm2
-rw-r--r--test/nums.tm2
-rw-r--r--test/optionals.tm4
-rw-r--r--test/paths.tm2
-rw-r--r--test/rng.tm16
-rw-r--r--test/text.tm10
9 files changed, 30 insertions, 30 deletions
diff --git a/test/bytes.tm b/test/bytes.tm
index b312c308..f9a872dc 100644
--- a/test/bytes.tm
+++ b/test/bytes.tm
@@ -2,10 +2,10 @@
func main():
!! Test bytes:
>> Byte(100)
- = Byte(0x64)
+ = 0x64
>> Byte(0xFF)
- = Byte(0xFF)
+ = 0xFF
>> b := Byte(0x0F)
>> b:hex()
diff --git a/test/inline_c.tm b/test/inline_c.tm
index 3c0949cd..6e5b119e 100644
--- a/test/inline_c.tm
+++ b/test/inline_c.tm
@@ -1,7 +1,7 @@
func main():
>> inline C:Int32 { int x = 1 + 2; x }
- = Int32(3)
+ = 3
>> inline C {
say(Text("Inline C code works!"), true);
diff --git a/test/integers.tm b/test/integers.tm
index 323508da..02ae519b 100644
--- a/test/integers.tm
+++ b/test/integers.tm
@@ -12,20 +12,20 @@ func main():
= 10
>> Int8(1) + Int16(2)
- = Int16(3)
+ = 3 : Int16
>> 1 << 10
= 1024
!! Signed and unsigned bit shifting:
>> Int64(-2) << 1
- = Int64(-4)
+ = -4 : Int64
>> Int64(-2) <<< 1
- = Int64(-4)
+ = -4 : Int64
>> Int64(-2) >> 1
- = Int64(-1)
+ = -1 : Int64
>> Int64(-2) >>> 1
- = Int64(9223372036854775807)
+ = 9223372036854775807 : Int64
>> 3 and 2
= 2
@@ -51,9 +51,9 @@ func main():
= "0o173"
>> Int64.min
- = Int64(-9223372036854775808)
+ = -9223372036854775808
>> Int64.max
- = Int64(9223372036854775807)
+ = 9223372036854775807
>> Int32(123):hex()
@@ -127,6 +127,6 @@ func main():
= 0
>> Int64(yes)
- = Int64(1)
+ = 1 : Int64
>> Int64(no)
- = Int64(0)
+ = 0 : Int64
diff --git a/test/moments.tm b/test/moments.tm
index 085237ca..508a064b 100644
--- a/test/moments.tm
+++ b/test/moments.tm
@@ -36,7 +36,7 @@ func main():
= "Tuesday"
>> t:unix_timestamp()
- = Int64(1704221100)
+ = 1704221100 : Int64
>> t == Moment.from_unix_timestamp(1704221100)
= yes
diff --git a/test/nums.tm b/test/nums.tm
index 98bcd9cd..1391a129 100644
--- a/test/nums.tm
+++ b/test/nums.tm
@@ -42,7 +42,7 @@ func main():
= no
>> Num32.sqrt(16)
- = Num32(4)
+ = 4 : Num32
>> 0.25:mix(10, 20)
= 12.5
diff --git a/test/optionals.tm b/test/optionals.tm
index cf9284e1..eba1a685 100644
--- a/test/optionals.tm
+++ b/test/optionals.tm
@@ -113,12 +113,12 @@ func main():
!! ...
!! Int64s:
>> yep := maybe_int64(yes)
- = Int64(123)?
+ = 123?
>> nope := maybe_int64(no)
= !Int64
>> if yep:
>> yep
- = Int64(123)
+ = 123
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
diff --git a/test/paths.tm b/test/paths.tm
index 6c1ee5f2..5e901453 100644
--- a/test/paths.tm
+++ b/test/paths.tm
@@ -25,7 +25,7 @@ func main():
>> tmpfile:read()
= "Hello world!"?
>> tmpfile:read_bytes()
- = [Byte(0x48), Byte(0x65), Byte(0x6C), Byte(0x6C), Byte(0x6F), Byte(0x20), Byte(0x77), Byte(0x6F), Byte(0x72), Byte(0x6C), Byte(0x64), Byte(0x21)]? : [Byte]?
+ = [0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x77, 0x6F, 0x72, 0x6C, 0x64, 0x21]? : [Byte]?
>> tmpdir:files():has(tmpfile)
= yes
diff --git a/test/rng.tm b/test/rng.tm
index 3f477d57..6c38caad 100644
--- a/test/rng.tm
+++ b/test/rng.tm
@@ -12,23 +12,23 @@ func main():
>> rng:int(1, 1000)
= 921
>> rng:int64(1, 1000)
- = Int64(324)
+ = 324 : Int64
>> rng:int32(1, 1000)
- = Int32(586)
+ = 586 : Int32
>> rng:int16(1, 1000)
- = Int16(453)
+ = 453 : Int16
>> rng:int8(1, 100)
- = Int8(53)
+ = 53 : Int8
>> rng:byte()
- = Byte(0xDC)
+ = 0xDC : Byte
>> rng:bytes(10)
- = [Byte(0xA0), Byte(0x5A), Byte(0x10), Byte(0x3F), Byte(0x6C), Byte(0xD1), Byte(0x35), Byte(0xC2), Byte(0x87), Byte(0x8C)]
+ = [0xA0, 0x5A, 0x10, 0x3F, 0x6C, 0xD1, 0x35, 0xC2, 0x87, 0x8C]
>> rng:bool(p=0.8)
= yes
>> rng:num()
- = 0.03492503353647658
+ = 0.03492503353647658 : Num
>> rng:num32(1, 1000)
- = Num32(761.05908)
+ = 761.05908 : Num32
!! Random array methods:
>> nums := [10*i for i in 10]
diff --git a/test/text.tm b/test/text.tm
index 173432ec..45d5c28f 100644
--- a/test/text.tm
+++ b/test/text.tm
@@ -29,9 +29,9 @@ func main():
>> amelie:split()
= ["A", "m", "é", "l", "i", "e"] : [Text]
>> amelie:utf32_codepoints()
- = [Int32(65), Int32(109), Int32(233), Int32(108), Int32(105), Int32(101)]
+ = [65, 109, 233, 108, 105, 101]
>> amelie:bytes()
- = [Byte(0x41), Byte(0x6D), Byte(0xC3), Byte(0xA9), Byte(0x6C), Byte(0x69), Byte(0x65)]
+ = [0x41, 0x6D, 0xC3, 0xA9, 0x6C, 0x69, 0x65]
>> Text.from_bytes([:Byte 0x41, 0x6D, 0xC3, 0xA9, 0x6C, 0x69, 0x65])!
= "Amélie"
>> Text.from_bytes([Byte(0xFF)])
@@ -41,9 +41,9 @@ func main():
>> amelie2:split()
= ["A", "m", "é", "l", "i", "e"] : [Text]
>> amelie2:utf32_codepoints()
- = [Int32(65), Int32(109), Int32(233), Int32(108), Int32(105), Int32(101)]
+ = [65, 109, 233, 108, 105, 101]
>> amelie2:bytes()
- = [Byte(0x41), Byte(0x6D), Byte(0xC3), Byte(0xA9), Byte(0x6C), Byte(0x69), Byte(0x65)]
+ = [0x41, 0x6D, 0xC3, 0xA9, 0x6C, 0x69, 0x65]
>> amelie:codepoint_names()
= ["LATIN CAPITAL LETTER A", "LATIN SMALL LETTER M", "LATIN SMALL LETTER E WITH ACUTE", "LATIN SMALL LETTER L", "LATIN SMALL LETTER I", "LATIN SMALL LETTER E"]
@@ -216,7 +216,7 @@ func main():
>> house:codepoint_names()
= ["CJK Unified Ideographs-5BB6"]
>> house:utf32_codepoints()
- = [Int32(23478)]
+ = [23478]
>> "🐧":codepoint_names()
= ["PENGUIN"]