Skip to content

Commit

Permalink
add snaps for new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomocavalieri authored and lpil committed Sep 7, 2023
1 parent a0f261a commit d7a3fbf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: compiler-core/src/javascript/tests/strings.rs
expression: "\npub fn go(x) {\n case x {\n \"Hello, \" as greeting <> name -> greeting\n _ -> \"Unknown\"\n }\n}\n"
---
export function go(x) {
if (x.startsWith("Hello, ")) {
let name = x.slice(7);
return "Hello, ";
} else {
return "Unknown";
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
source: compiler-core/src/javascript/tests/strings.rs
expression: "\npub fn go(x) {\n case x {\n \"Hello, \" as x <> name -> x\n _ -> \"Unknown\"\n }\n}\n"
---
export function go(x) {
if (x.startsWith("Hello, ")) {
let name = x.slice(7);
return "Hello, ";
} else {
return "Unknown";
}
}

0 comments on commit d7a3fbf

Please sign in to comment.