Add new acceptance test scenario: 052
Pattern-match on unary constructors.
This commit is contained in:
17
examples/acceptance_tests/052/lib/tests.ak
Normal file
17
examples/acceptance_tests/052/lib/tests.ak
Normal file
@@ -0,0 +1,17 @@
|
||||
type TransactionId {
|
||||
inner: ByteArray,
|
||||
}
|
||||
|
||||
test pattern_match_let() {
|
||||
let x = TransactionId { inner: #"0000" }
|
||||
let TransactionId(y) = x
|
||||
y == #"0000"
|
||||
}
|
||||
|
||||
test pattern_match_when() {
|
||||
let x = TransactionId { inner: #"0000" }
|
||||
let y = when x is {
|
||||
TransactionId(y) -> y
|
||||
}
|
||||
y == #"0000"
|
||||
}
|
||||
Reference in New Issue
Block a user