Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

add tests and snapshots

+46 -6
+16 -1
compiler-core/src/javascript/tests/case.rs
··· 1001 1001 ) 1002 1002 } 1003 1003 1004 + fn no_duplicate_let_after_case_with_same_named_variable_with_declaration_before_and_after() { 1005 + assert_js!( 1006 + r#" 1007 + pub fn go() { 1008 + let x = 0 1009 + let x = case #(1, 2) { 1010 + #(_, x) -> x 1011 + } 1012 + 1013 + let x = x 1014 + x 1015 + }"# 1016 + ) 1017 + } 1018 + 1019 + #[test] 1004 1020 fn no_duplicate_let_after_case_with_same_named_variable() { 1005 1021 assert_js!( 1006 1022 r#" 1007 1023 pub fn go() { 1008 - let x = 0 1009 1024 let x = case #(1, 2) { 1010 1025 #(_, x) -> x 1011 1026 }
+3 -5
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__no_duplicate_let_after_case_with_same_named_variable.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - expression: "\npub fn go() {\n let x = 0\n let x = case #(1, 2) {\n #(_, x) -> x\n }\n\n x\n}" 3 + expression: "\npub fn go() {\n let x = case #(1, 2) {\n #(_, x) -> x\n }\n\n x\n}" 4 4 --- 5 5 ----- SOURCE CODE 6 6 7 7 pub fn go() { 8 - let x = 0 9 8 let x = case #(1, 2) { 10 9 #(_, x) -> x 11 10 } ··· 15 14 16 15 ----- COMPILED JAVASCRIPT 17 16 export function go() { 18 - let x = 0; 19 17 let _block; 20 18 let $ = [1, 2]; 21 - let x$1 = $[1]; 22 - _block = x$1; 19 + let x = $[1]; 20 + _block = x; 23 21 let x$1 = _block; 24 22 return x$1; 25 23 }
+27
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__no_duplicate_let_after_case_with_same_named_variable_with_declaration_before_and_after.snap
··· 1 + --- 2 + source: compiler-core/src/javascript/tests/case.rs 3 + expression: "\npub fn go() {\n let x = 0\n let x = case #(1, 2) {\n #(_, x) -> x\n }\n\n let x = x\n x\n}" 4 + --- 5 + ----- SOURCE CODE 6 + 7 + pub fn go() { 8 + let x = 0 9 + let x = case #(1, 2) { 10 + #(_, x) -> x 11 + } 12 + 13 + let x = x 14 + x 15 + } 16 + 17 + ----- COMPILED JAVASCRIPT 18 + export function go() { 19 + let x = 0; 20 + let _block; 21 + let $ = [1, 2]; 22 + let x$1 = $[1]; 23 + _block = x$1; 24 + let x$2 = _block; 25 + let x$3 = x$2; 26 + return x$3; 27 + }