Skip to content

Commit

Permalink
more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchmura committed Dec 23, 2024
1 parent 72208ec commit 9ed1d0b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/tests/__snapshots__/compiler.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ Found 1 error in server/src/tests/cases/compiler/typePredicate1.c:7
"
`;

exports[`Compiler compiler/typePredicate2.c Reports correct errors for compiler/typePredicate2.c: diags-compiler/typePredicate2.c 1`] = `""`;

exports[`Compiler compiler/unionTypes.c Reports correct errors for compiler/unionTypes.c: diags-compiler/unionTypes.c 1`] = `""`;

exports[`Compiler compiler/utf8.c Reports correct errors for compiler/utf8.c: diags-compiler/utf8.c 1`] = `""`;
Expand Down
17 changes: 17 additions & 0 deletions server/src/tests/cases/compiler/typePredicate2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
test() {
mixed o;
if (fn(o)) {
int id = o->query_number();
}
}

/**
*
* @param o
* @returns {o is "object.c"}
*/
fn(mixed o) {
return 1;
}

// @files: object.c

0 comments on commit 9ed1d0b

Please sign in to comment.