Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-y committed Sep 19, 2024
1 parent 5b96b68 commit e6b2359
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/__tests__/compiler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ describe("E2E Compiler Pipeline", () => {
12,
4,
597, // Modules
9, // Generic impls
17,
82,
]);
});

Expand Down
12 changes: 12 additions & 0 deletions src/__tests__/fixtures/e2e-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ pub fn test13()
let c = a.do_work(b)
c.z // 9
// Test structural object field access
fn get_y_field(obj: { y: i32 }) -> i32
obj.y
pub fn test14()
let obj = { y: 17, z: 689 }
get_y_field(obj)
// Test that structural parameters can accept matching nominal types
pub fn test15() -> i32
let point = Point { x: 1, y: 82, z: 3 }
get_y_field(point)
`;

export const tcoText = `
Expand Down

0 comments on commit e6b2359

Please sign in to comment.