diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-12 04:09:52 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-12 04:09:52 -0400 |
| commit | 43f4f3610e5258afbfb9e313c989e1e52f477c38 (patch) | |
| tree | 1f960cd930ed7e1e251ed24700c613a01221443b /test | |
| parent | fb6dc0a8b9b5537ef708778bf013f71f98fad41f (diff) | |
For single-member structs/enums, don't print the member name
Diffstat (limited to 'test')
| -rw-r--r-- | test/enums.tm | 4 | ||||
| -rw-r--r-- | test/import.tm | 2 | ||||
| -rw-r--r-- | test/optionals.tm | 4 | ||||
| -rw-r--r-- | test/structs.tm | 3 | ||||
| -rw-r--r-- | test/threads.tm | 2 |
5 files changed, 9 insertions, 6 deletions
diff --git a/test/enums.tm b/test/enums.tm index 98811408..a96f5784 100644 --- a/test/enums.tm +++ b/test/enums.tm @@ -19,7 +19,7 @@ func main(): >> Foo.Zero = Foo.Zero >> Foo.One(123) - = Foo.One(x=123) + = Foo.One(123) >> Foo.Two(123, 456) = Foo.Two(x=123, y=456) @@ -59,7 +59,7 @@ func main(): >> choose_text(Foo.Four(1,2,3,4)) = "Four" >> choose_text(Foo.Last("XX")) - = "else: Foo.Last(t=\"XX\")" + = "else: Foo.Last(\"XX\")" i := 1 cases := [Foo.One(1), Foo.One(2), Foo.Zero] diff --git a/test/import.tm b/test/import.tm index 9c878002..c7797963 100644 --- a/test/import.tm +++ b/test/import.tm @@ -14,7 +14,7 @@ func main(): >> [:ImportedType] >> returns_imported_type() - = ImportedType(name="Hello") + = ImportedType("Hello") >> needs_initializing # imported from ./use_import.tm = 999999999999999999 diff --git a/test/optionals.tm b/test/optionals.tm index c0c600a7..5c18d58d 100644 --- a/test/optionals.tm +++ b/test/optionals.tm @@ -215,12 +215,12 @@ func main(): !! ... !! Enums: >> yep := Enum.maybe(yes) - = Enum.Y(y=123)? + = Enum.Y(123)? >> nope := Enum.maybe(no) = !Enum >> if yep: >> yep - = Enum.Y(y=123) + = Enum.Y(123) else: fail("Falsey: $yep") >> if nope: fail("Truthy: $nope") diff --git a/test/structs.tm b/test/structs.tm index 53d356f5..d68bbe8b 100644 --- a/test/structs.tm +++ b/test/structs.tm @@ -1,4 +1,5 @@ +struct Single(x:Int) struct Pair(x,y:Int) struct Mixed(x:Int, text:Text) struct LinkedList(x:Int, next=!@LinkedList) @@ -8,6 +9,8 @@ struct CorecursiveA(other:@CorecursiveB?) struct CorecursiveB(other=!@CorecursiveA) func test_literals(): + >> Single(123) + = Single(123) >> x := Pair(10, 20) = Pair(x=10, y=20) >> y := Pair(y=20, 10) diff --git a/test/threads.tm b/test/threads.tm index 2f259a0e..2ac2b679 100644 --- a/test/threads.tm +++ b/test/threads.tm @@ -22,7 +22,7 @@ func main(): jobs := |:Job; max_size=2| >> jobs:give(Increment(5)) >> jobs:peek() - = Job.Increment(x=5) + = Job.Increment(5) results := |:Int; max_size| >> thread := Thread.new(func(): |
