Skip to content

Commit

Permalink
test: add playground sample for tuple structs
Browse files Browse the repository at this point in the history
To ensure the tuple variant is working and doesn't include oversights
like the previous missing `pub` visibility modifier.
  • Loading branch information
dnaka91 committed Nov 3, 2023
1 parent 7dcc660 commit 6f9e8ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/stef-playground/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ mod tests {
});
}

#[test]
fn sample3() {
roundtrip(&sample::Sample3(true, (vec![1, 2, 3, 4, 5], -500_000)));
}

#[test]
fn sample_gen() {
roundtrip(&sample::gens::SampleGen {
Expand Down
3 changes: 3 additions & 0 deletions crates/stef-playground/src/sample.stef
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ enum Sample2 {
} @3,
}

/// A tuple struct.
struct Sample3(bool @1, (bytes, i64) @2)

const CHRISTMAS_MONTH: u8 = 12;
const CHRISTMAS_DAY: u8 = 24;

Expand Down

0 comments on commit 6f9e8ab

Please sign in to comment.