Add new acceptance test scenario: 052

Pattern-match on unary constructors.
This commit is contained in:
KtorZ 2023-02-07 14:49:37 +01:00 committed by Lucas
parent c50bf94020
commit cf7a20b986
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# This file was generated by Aiken
# You typically do not need to edit this file
requirements = []
packages = []

View File

@ -0,0 +1,3 @@
name = 'aiken-lang/acceptance_test_052'
version = '0.0.0'
description = ''

View 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"
}