test: Add test for pattern matching on sum types

This commit is contained in:
Vincent Ambo 2019-08-28 14:33:41 +01:00
parent cb45536124
commit 34a5917981

View file

@ -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");