aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-06 13:40:17 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-06 13:40:17 -0400
commit59845e610f2c90474f34079d27b5f1e07071ded4 (patch)
tree1066ab6c5c6e6620adda6ac4575703b9d4bf0a0a /test
parent95633b1cc2da5294d9aec8c7eb9fca9a15c1a8bf (diff)
Deprecate `!!` print statement
Diffstat (limited to 'test')
-rw-r--r--test/bytes.tm2
-rw-r--r--test/integers.tm2
-rw-r--r--test/lambdas.tm2
-rw-r--r--test/optionals.tm56
-rw-r--r--test/paths.tm24
-rw-r--r--test/reductions.tm2
-rw-r--r--test/text.tm10
7 files changed, 48 insertions, 50 deletions
diff --git a/test/bytes.tm b/test/bytes.tm
index b312c308..a62acd10 100644
--- a/test/bytes.tm
+++ b/test/bytes.tm
@@ -1,6 +1,6 @@
func main():
- !! Test bytes:
+ say("Test bytes:")
>> Byte(100)
= Byte(0x64)
diff --git a/test/integers.tm b/test/integers.tm
index 04256c88..76e55ca1 100644
--- a/test/integers.tm
+++ b/test/integers.tm
@@ -17,7 +17,7 @@ func main():
>> 1 << 10
= 1024
- !! Signed and unsigned bit shifting:
+ say("Signed and unsigned bit shifting:")
>> Int64(-2) << 1
= Int64(-4)
>> Int64(-2) <<< 1
diff --git a/test/lambdas.tm b/test/lambdas.tm
index b1bc2968..3d536086 100644
--- a/test/lambdas.tm
+++ b/test/lambdas.tm
@@ -36,7 +36,7 @@ func main():
fn := func():
return func():
return func():
- defer: !! $outer
+ defer: say("$outer")
return outer
>> fn()()()
= "Hello"
diff --git a/test/optionals.tm b/test/optionals.tm
index 703e74e9..316b2e71 100644
--- a/test/optionals.tm
+++ b/test/optionals.tm
@@ -86,7 +86,7 @@ func main():
= -1
do:
- !! Ints:
+ say("Ints:")
>> yep := maybe_int(yes)
= 123?
>> nope := maybe_int(no)
@@ -97,11 +97,10 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! Int64s:
+ say("Int64s:")
>> yep := maybe_int64(yes)
= Int64(123)?
>> nope := maybe_int64(no)
@@ -112,11 +111,10 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! Arrays:
+ say("Arrays:")
>> yep := maybe_array(yes)
= [10, 20, 30]?
>> nope := maybe_array(no)
@@ -127,11 +125,11 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! Bools:
+ say("...")
+ say("Bools:")
>> yep := maybe_bool(yes)
= no?
>> nope := maybe_bool(no)
@@ -142,11 +140,11 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! Text:
+ say("...")
+ say("Text:")
>> yep := maybe_text(yes)
= "Hello"?
>> nope := maybe_text(no)
@@ -157,11 +155,11 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! Nums:
+ say("...")
+ say("Nums:")
>> yep := maybe_num(yes)
= 12.3?
>> nope := maybe_num(no)
@@ -172,11 +170,11 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! Lambdas:
+ say("...")
+ say("Lambdas:")
# >> yep := maybe_lambda(yes)
# = func() [optionals.tm:54] : func()?
>> nope := maybe_lambda(no)
@@ -187,11 +185,11 @@ func main():
# else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! Structs:
+ say("...")
+ say("Structs:")
>> yep := Struct.maybe(yes)
= Struct(x=123, y="hello")?
>> nope := Struct.maybe(no)
@@ -202,11 +200,11 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! Enums:
+ say("...")
+ say("Enums:")
>> yep := Enum.maybe(yes)
= Enum.Y(123)?
>> nope := Enum.maybe(no)
@@ -217,11 +215,11 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
do:
- !! ...
- !! C Strings:
+ say("...")
+ say("C Strings:")
>> yep := maybe_c_string(yes)
= CString("hi")?
>> nope := maybe_c_string(no)
@@ -232,7 +230,7 @@ func main():
else: fail("Falsey: $yep")
>> if nope:
fail("Truthy: $nope")
- else: !! Falsey: $nope
+ else: say("Falsey: $nope")
if yep := maybe_int(yes):
>> yep
diff --git a/test/paths.tm b/test/paths.tm
index e8cfd2ab..e448dee1 100644
--- a/test/paths.tm
+++ b/test/paths.tm
@@ -82,49 +82,49 @@ func main():
= (..)
# Concatenation tests:
- !! Basic relative path concatenation:
+ say("Basic relative path concatenation:")
>> (/foo) ++ (./baz)
= (/foo/baz)
- !! Concatenation with a current directory (`.`):
+ say("Concatenation with a current directory (`.`):")
>> (/foo/bar) ++ (./.)
= (/foo/bar)
- !! Trailing slash in the first path:
+ say("Trailing slash in the first path:")
>> (/foo/) ++ (./baz)
= (/foo/baz)
- !! Trailing slash in the second path:
+ say("Trailing slash in the second path:")
>> (/foo/bar) ++ (./baz/)
= (/foo/bar/baz)
- !! Removing redundant current directory (`.`):
+ say("Removing redundant current directory (`.`):")
>> (/foo/bar) ++ (./baz/./qux)
= (/foo/bar/baz/qux)
- !! Removing redundant parent directory (`..`):
+ say("Removing redundant parent directory (`..`):")
>> (/foo/bar) ++ (./baz/qux/../quux)
= (/foo/bar/baz/quux)
- !! Collapsing `..` to navigate up:
+ say("Collapsing `..` to navigate up:")
>> (/foo/bar/baz) ++ (../qux)
= (/foo/bar/qux)
- !! Current directory and parent directory mixed:
+ say("Current directory and parent directory mixed:")
>> (/foo/bar) ++ (././../baz)
= (/foo/baz)
- !! Path begins with a `.`:
+ say("Path begins with a `.`:")
>> (/foo) ++ (./baz/../qux)
= (/foo/qux)
- !! Multiple slashes:
+ say("Multiple slashes:")
>> (/foo) ++ (./baz//qux)
= (/foo/baz/qux)
- !! Complex path with multiple `.` and `..`:
+ say("Complex path with multiple `.` and `..`:")
>> (/foo/bar/baz) ++ (./.././qux/./../quux)
= (/foo/bar/quux)
- !! Globbing:
+ say("Globbing:")
>> (./*.tm):glob()
diff --git a/test/reductions.tm b/test/reductions.tm
index f0618b21..f2fa4b9c 100644
--- a/test/reductions.tm
+++ b/test/reductions.tm
@@ -27,7 +27,7 @@ func main():
>> (_max_.y:abs(): [Foo(0, 0), Foo(1, 0), Foo(0, 10), Foo(0, -999)])!
= Foo(x=0, y=-999)
- !! (or) and (and) have early out behavior:
+ say("(or) and (and) have early out behavior:")
>> (or: i == 3 for i in 9999999999999999999999999999)!
= yes
diff --git a/test/text.tm b/test/text.tm
index 2e061415..df48470e 100644
--- a/test/text.tm
+++ b/test/text.tm
@@ -1,6 +1,6 @@
func main():
str := "Hello Amélie!"
- !! Testing strings like $str
+ say("Testing strings like $str")
>> str:upper()
= "HELLO AMÉLIE!"
@@ -100,7 +100,7 @@ func main():
"
= "line one$\nline two"
- !! Interpolation tests:
+ say("Interpolation tests:")
>> "A $(1+2)"
= "A 3"
>> 'A $(1+2)'
@@ -138,7 +138,7 @@ func main():
>> "":lines()
= []
- !! Test splitting and joining text:
+ say("Test splitting and joining text:")
>> "one,, two,three":split(",")
= ["one", "", " two", "three"]
>> [t for t in "one,, two,three":by_split(",")]
@@ -177,7 +177,7 @@ func main():
>> "":split()
= []
- !! Test text slicing:
+ say("Test text slicing:")
>> "abcdef":slice()
= "abcdef"
>> "abcdef":slice(from=3)
@@ -237,7 +237,7 @@ func main():
= "eilémA olleh"
do:
- !! Testing concatenation-stability:
+ say("Testing concatenation-stability:")
ab := Text.from_codepoint_names(["LATIN SMALL LETTER E", "COMBINING VERTICAL LINE BELOW"])!
>> ab:codepoint_names()
= ["LATIN SMALL LETTER E", "COMBINING VERTICAL LINE BELOW"]