test: Add test for pattern matching on sum types
This commit is contained in:
parent
cb45536124
commit
34a5917981
1 changed files with 5 additions and 0 deletions
|
@ -63,6 +63,11 @@ deepSeq rec {
|
|||
};
|
||||
};
|
||||
|
||||
testSumMatch = creature.match testSum {
|
||||
human = v: "It's a human named ${v.name}";
|
||||
pet = v: throw "It's not supposed to be a pet!";
|
||||
};
|
||||
|
||||
# Test curried function definitions
|
||||
func = defun [ string int string ]
|
||||
(name: age: "${name} is ${toString age} years old");
|
||||
|
|
Loading…
Reference in a new issue