Add new acceptance test scenario: 052
Pattern-match on unary constructors.
This commit is contained in:
5
examples/acceptance_tests/052/aiken.lock
Normal file
5
examples/acceptance_tests/052/aiken.lock
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was generated by Aiken
|
||||
# You typically do not need to edit this file
|
||||
|
||||
requirements = []
|
||||
packages = []
|
||||
3
examples/acceptance_tests/052/aiken.toml
Normal file
3
examples/acceptance_tests/052/aiken.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
name = 'aiken-lang/acceptance_test_052'
|
||||
version = '0.0.0'
|
||||
description = ''
|
||||
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