diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-11-24 16:18:21 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-11-24 16:18:21 -0500 |
| commit | 1e3fb8a2c0cca385d65c52679411b118b5fb4641 (patch) | |
| tree | e8e7ae5b4a8b4f39ed867c238f1a05494b6a50ac /test | |
| parent | 0e10313d64f54dd587ebbcd5f413bd999333c911 (diff) | |
Rename "NULL" to "NONE"
Diffstat (limited to 'test')
| -rw-r--r-- | test/arrays.tm | 4 | ||||
| -rw-r--r-- | test/nums.tm | 8 | ||||
| -rw-r--r-- | test/optionals.tm | 30 | ||||
| -rw-r--r-- | test/paths.tm | 4 | ||||
| -rw-r--r-- | test/reductions.tm | 4 | ||||
| -rw-r--r-- | test/tables.tm | 6 | ||||
| -rw-r--r-- | test/text.tm | 14 |
7 files changed, 35 insertions, 35 deletions
diff --git a/test/arrays.tm b/test/arrays.tm index a6de26ce..6f99f3f2 100644 --- a/test/arrays.tm +++ b/test/arrays.tm @@ -166,9 +166,9 @@ func main(): >> ["a", "b", "c"]:find("b") = 2 : Int? >> ["a", "b", "c"]:find("XXX") - = NULL : Int? + = NONE : Int? >> [10, 20]:first(func(i:&Int): i:is_prime()) - = NULL : Int? + = NONE : Int? >> [4, 5, 6]:first(func(i:&Int): i:is_prime()) = 2 : Int? diff --git a/test/nums.tm b/test/nums.tm index 4e6d34a9..9d3e9a6e 100644 --- a/test/nums.tm +++ b/test/nums.tm @@ -23,9 +23,9 @@ func main(): = yes >> Num.NAN - = NULL : Num? + = NONE : Num? >> nan := Num.NAN - = NULL : Num? + = NONE : Num? >> nan == nan = yes >> nan < nan @@ -48,10 +48,10 @@ func main(): = -1 >> nan + 1 - = NULL : Num? + = NONE : Num? >> 0./0. - = NULL : Num? + = NONE : Num? >> Num.PI:cos()!:near(-1) = yes diff --git a/test/optionals.tm b/test/optionals.tm index 8efae414..84a4a9ca 100644 --- a/test/optionals.tm +++ b/test/optionals.tm @@ -4,7 +4,7 @@ struct Struct(x:Int, y:Text): if should_i: return Struct(123, "hello") else: - return NULL + return NONE enum Enum(X, Y(y:Int)): func maybe(should_i:Bool->Enum?): @@ -100,7 +100,7 @@ func main(): >> yep := maybe_int(yes) = 123 : Int? >> nope := maybe_int(no) - = NULL : Int? + = NONE : Int? >> if yep: >> yep = 123 @@ -115,7 +115,7 @@ func main(): >> yep := maybe_int64(yes) = 123 : Int64? >> nope := maybe_int64(no) - = NULL : Int64? + = NONE : Int64? >> if yep: >> yep = 123 @@ -130,7 +130,7 @@ func main(): >> yep := maybe_array(yes) = [10, 20, 30] : [Int]? >> nope := maybe_array(no) - = NULL : [Int]? + = NONE : [Int]? >> if yep: >> yep = [10, 20, 30] @@ -145,7 +145,7 @@ func main(): >> yep := maybe_bool(yes) = no : Bool? >> nope := maybe_bool(no) - = NULL : Bool? + = NONE : Bool? >> if yep: >> yep = no @@ -160,7 +160,7 @@ func main(): >> yep := maybe_text(yes) = "Hello" : Text? >> nope := maybe_text(no) - = NULL : Text? + = NONE : Text? >> if yep: >> yep = "Hello" @@ -175,7 +175,7 @@ func main(): >> yep := maybe_num(yes) = 12.3 : Num? >> nope := maybe_num(no) - = NULL : Num? + = NONE : Num? >> if yep: >> yep = 12.3 @@ -190,7 +190,7 @@ func main(): >> yep := maybe_lambda(yes) = func() [optionals.tm:54] : func()? >> nope := maybe_lambda(no) - = NULL : func()? + = NONE : func()? >> if yep: >> yep = func() [optionals.tm:54] @@ -205,7 +205,7 @@ func main(): >> yep := Struct.maybe(yes) = Struct(x=123, y="hello") : Struct? >> nope := Struct.maybe(no) - = NULL : Struct? + = NONE : Struct? >> if yep: >> yep = Struct(x=123, y="hello") @@ -220,7 +220,7 @@ func main(): >> yep := Enum.maybe(yes) = Enum.Y(123) : Enum? >> nope := Enum.maybe(no) - = NULL : Enum? + = NONE : Enum? >> if yep: >> yep = Enum.Y(123) @@ -235,7 +235,7 @@ func main(): >> yep := maybe_c_string(yes) = CString("hi") : CString? >> nope := maybe_c_string(no) - = NULL : CString? + = NONE : CString? >> if yep: >> yep = CString("hi") @@ -250,7 +250,7 @@ func main(): >> yep := maybe_channel(yes) # No "=" test here because channels use addresses in the text version >> nope := maybe_channel(no) - = NULL : |:Int|? + = NONE : |:Int|? >> if yep: >> yep else: fail("Falsey: $yep") >> if nope: @@ -263,7 +263,7 @@ func main(): >> yep := maybe_thread(yes) # No "=" test here because threads use addresses in the text version >> nope := maybe_thread(no) - = NULL : Thread? + = NONE : Thread? >> if yep: >> yep else: fail("Falsey: $yep") >> if nope: @@ -284,9 +284,9 @@ func main(): >> (5? == 5?) = yes >> {!Int, !Int} - = {NULL} + = {NONE} >> [5?, !Int, !Int, 6?]:sorted() - = [NULL, NULL, 5, 6] + = [NONE, NONE, 5, 6] do: >> value := if var := 5?: diff --git a/test/paths.tm b/test/paths.tm index 62cecec6..25cb4e59 100644 --- a/test/paths.tm +++ b/test/paths.tm @@ -36,9 +36,9 @@ func main(): fail("Couldn't read lines in $tmpfile") >> (./does-not-exist.xxx):read() - = NULL : Text? + = NONE : Text? >> (./does-not-exist.xxx):read_bytes() - = NULL : [Byte]? + = NONE : [Byte]? if lines := (./does-not-exist.xxx):by_line(): fail("I could read lines in a nonexistent file") else: diff --git a/test/reductions.tm b/test/reductions.tm index 23ccf097..26f3533c 100644 --- a/test/reductions.tm +++ b/test/reductions.tm @@ -5,7 +5,7 @@ func main(): = 60 : Int? >> (+: [:Int]) - = NULL : Int? + = NONE : Int? >> (+: [10, 20, 30]) or 0 = 60 @@ -37,7 +37,7 @@ func main(): = yes >> (<=: [:Int]) - = NULL : Bool? + = NONE : Bool? >> (<=: [5, 4, 3, 2, 1])! = no diff --git a/test/tables.tm b/test/tables.tm index 85ce5e01..acda0eb5 100644 --- a/test/tables.tm +++ b/test/tables.tm @@ -7,7 +7,7 @@ func main(): >> t:get("two") = 2 : Int? >> t:get("???") - = NULL : Int? + = NONE : Int? >> t:get("one")! = 1 >> t:get("???") or -1 @@ -22,7 +22,7 @@ func main(): >> t.length = 2 >> t.fallback - = NULL : {Text:Int}? + = NONE : {Text:Int}? >> t.keys = ["one", "two"] @@ -37,7 +37,7 @@ func main(): >> t2:get("three") = 3 : Int? >> t2:get("???") - = NULL : Int? + = NONE : Int? >> t2.length = 1 diff --git a/test/text.tm b/test/text.tm index cd00940f..c6fb6ad7 100644 --- a/test/text.tm +++ b/test/text.tm @@ -35,7 +35,7 @@ func main(): >> Text.from_bytes([:Byte 0x41, 0x6D, 0xC3, 0xA9, 0x6C, 0x69, 0x65])! = "Amélie" >> Text.from_bytes([Byte(0xFF)]) - = NULL : Text? + = NONE : Text? >> amelie2 := "Am$(\U65\U301)lie" >> amelie2:split() @@ -189,9 +189,9 @@ func main(): !! Test text:find() >> " one two three ":find($/{id}/, start=-999) - = NULL : Match? + = NONE : Match? >> " one two three ":find($/{id}/, start=999) - = NULL : Match? + = NONE : Match? >> " one two three ":find($/{id}/) = Match(text="one", index=2, captures=["one"]) : Match? >> " one two three ":find($/{id}/, start=5) @@ -222,7 +222,7 @@ func main(): = ["PENGUIN"] >> Text.from_codepoint_names(["not a valid name here buddy"]) - = NULL : Text? + = NONE : Text? >> "one two; three four":find_all($/; {..}/) = [Match(text="; three four", index=8, captures=["three four"])] @@ -249,11 +249,11 @@ func main(): >> "Hello":matches($/{id}/) = ["Hello"] : [Text]? >> "Hello":matches($/{lower}/) - = NULL : [Text]? + = NONE : [Text]? >> "Hello":matches($/{upper}/) - = NULL : [Text]? + = NONE : [Text]? >> "Hello...":matches($/{id}/) - = NULL : [Text]? + = NONE : [Text]? if matches := "hello world":matches($/{id} {id}/): >> matches |
