From 1febd9b377a4c22431adb2c199a0e0a8bfc4eef1 Mon Sep 17 00:00:00 2001 From: keiravillekode Date: Sat, 4 Jan 2025 02:00:31 +1100 Subject: [PATCH] Tests use inputLengthEncoded (#140) [no important files changed] --- exercises/practice/matching-brackets/matching-brackets.wat | 2 +- exercises/practice/nucleotide-count/nucleotide-count.spec.js | 2 +- exercises/practice/reverse-string/reverse-string.spec.js | 2 +- exercises/practice/rna-transcription/rna-transcription.spec.js | 2 +- exercises/practice/rotational-cipher/rotational-cipher.spec.js | 2 +- .../practice/run-length-encoding/run-length-encoding.spec.js | 2 +- exercises/practice/two-fer/two-fer.spec.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/practice/matching-brackets/matching-brackets.wat b/exercises/practice/matching-brackets/matching-brackets.wat index 6284803..674ff59 100644 --- a/exercises/practice/matching-brackets/matching-brackets.wat +++ b/exercises/practice/matching-brackets/matching-brackets.wat @@ -1,7 +1,7 @@ (module (memory (export "mem") 1) - ;; Determines of the brackets in a string is balanced. + ;; Determines if the brackets in a string are balanced. ;; ;; @param {i32} text - the offset where the text string begins in memory ;; @param {i32} length - the length of the text diff --git a/exercises/practice/nucleotide-count/nucleotide-count.spec.js b/exercises/practice/nucleotide-count/nucleotide-count.spec.js index 3d958c7..dddc5a1 100644 --- a/exercises/practice/nucleotide-count/nucleotide-count.spec.js +++ b/exercises/practice/nucleotide-count/nucleotide-count.spec.js @@ -30,7 +30,7 @@ function countNucleotides(input) { // Pass offset and length to WebAssembly function return currentInstance.exports.countNucleotides( inputBufferOffset, - input.length + inputLengthEncoded ); } diff --git a/exercises/practice/reverse-string/reverse-string.spec.js b/exercises/practice/reverse-string/reverse-string.spec.js index 885fabb..fb73cac 100644 --- a/exercises/practice/reverse-string/reverse-string.spec.js +++ b/exercises/practice/reverse-string/reverse-string.spec.js @@ -30,7 +30,7 @@ function reverseString(input) { // Pass offset and length to WebAssembly function const [outputOffset, outputLength] = currentInstance.exports.reverseString( inputBufferOffset, - input.length + inputLengthEncoded ); expect(outputLength).toEqual(inputLengthEncoded); diff --git a/exercises/practice/rna-transcription/rna-transcription.spec.js b/exercises/practice/rna-transcription/rna-transcription.spec.js index 94cd56c..9589882 100644 --- a/exercises/practice/rna-transcription/rna-transcription.spec.js +++ b/exercises/practice/rna-transcription/rna-transcription.spec.js @@ -30,7 +30,7 @@ function toRna(input) { // Pass offset and length to WebAssembly function const [outputOffset, outputLength] = currentInstance.exports.toRna( inputBufferOffset, - input.length + inputLengthEncoded ); expect(outputLength).toEqual(input.length); diff --git a/exercises/practice/rotational-cipher/rotational-cipher.spec.js b/exercises/practice/rotational-cipher/rotational-cipher.spec.js index fc7a862..d873324 100644 --- a/exercises/practice/rotational-cipher/rotational-cipher.spec.js +++ b/exercises/practice/rotational-cipher/rotational-cipher.spec.js @@ -29,7 +29,7 @@ function rotate(text, shiftKey) { const [outputOffset, outputLength] = currentInstance.exports.rotate( inputBufferOffset, - text.length, + inputLengthEncoded, shiftKey ); expect(outputLength).toEqual(text.length); diff --git a/exercises/practice/run-length-encoding/run-length-encoding.spec.js b/exercises/practice/run-length-encoding/run-length-encoding.spec.js index ea48a3c..4650200 100644 --- a/exercises/practice/run-length-encoding/run-length-encoding.spec.js +++ b/exercises/practice/run-length-encoding/run-length-encoding.spec.js @@ -29,7 +29,7 @@ function invoke(funcName, input) { const [ outputOffset, outputLength ] = currentInstance.exports[funcName]( inputBufferOffset, - input.length + inputLengthEncoded ); return currentInstance.get_mem_as_utf8(outputOffset, outputLength); diff --git a/exercises/practice/two-fer/two-fer.spec.js b/exercises/practice/two-fer/two-fer.spec.js index b085546..3627e33 100644 --- a/exercises/practice/two-fer/two-fer.spec.js +++ b/exercises/practice/two-fer/two-fer.spec.js @@ -30,7 +30,7 @@ function twoFer(input = "") { // Pass offset and length to WebAssembly function const [outputOffset, outputLength] = currentInstance.exports.twoFer( inputOffset, - input.length + inputLengthEncoded ); // Decode JS string from returned offset and length