Skip to content

Commit

Permalink
additional nested datatype test
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-rohde committed Oct 31, 2024
1 parent da2e55a commit 8324ea5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/air/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2190,6 +2190,21 @@ fn nested_datatype_field_update_pass() {
)
}

#[test]
fn nested_datatype_field_update_pass2() {
yes!(
(declare-datatypes ((A 0)) (((A_A (A_A_u Int) (A_A_v Int)))))
(declare-datatypes ((B 0)) (((B_B (B_B_a1 A) (B_B_a2 A)))))
(check-valid
(declare-var b B)
(block
(assign b ((_ update-field B_B_a1) b ((_ update-field A_A_u) (B_B_a1 b) 3)))
(assert (= (A_A_u (B_B_a1 b)) 3))
)
)
)
}

#[test]
fn nested_datatype_field_update_fail() {
no!(
Expand Down

0 comments on commit 8324ea5

Please sign in to comment.