hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 0177a332c666be1c03b59e8524fc425196147efe
parent 7e66b9a02b3a4e7c42dfde567094a1055dda3076
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sun, 10 Apr 2022 21:19:47 -0400

parse: add tests for tagged/tuple types

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mhare/parse/+test/types.ha | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/hare/parse/+test/types.ha b/hare/parse/+test/types.ha @@ -59,3 +59,20 @@ export type baz = enum rune { }; "); }; + +@test fn tuple() void = { + roundtrip("export type foo = (int, str); + +export type bar = (a, b::c, d); +"); +}; + +@test fn tagged_union() void = { + roundtrip("export type foo = (size | void); + +export type bar = (a | b::c | ...d); + +export type baz = (bat | foo::bar::baz | long_type_name | yet_another_very_long_type_name | + this_spans_multiple_lines | for_readability); +"); +};