From: Derick W. de M. Frias Date: Mon, 23 Jun 2025 06:35:47 GMT Subject: [PATCH v2 2/4] t4034: add tests for javascript word literals Message-ID: <20250623090538.154858-3-derick.william.moraes@gmail.com> In-Reply-To: <20250623090538.154858-1-derick.william.moraes@gmail.com> Add tests for javascript word pattern. Signed-off-by: Derick W. de M. Frias --- t/t4034-diff-words.sh | 1 + t/t4034/javascript/expect | 26 ++++++++++++++++++++++---- t/t4034/javascript/post | 16 ++++++++++++---- t/t4034/javascript/pre | 16 ++++++++++++---- 4 files changed, 47 insertions(+), 12 deletions(-) diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh index 0be647c2fb..5bf1294f27 100755 --- a/t/t4034-diff-words.sh +++ b/t/t4034-diff-words.sh @@ -328,6 +328,7 @@ test_language_driver dts test_language_driver fortran test_language_driver html test_language_driver java +test_language_driver javascript test_language_driver kotlin test_language_driver matlab test_language_driver objc diff --git a/t/t4034/javascript/expect b/t/t4034/javascript/expect index cc5e1253f6..98b057c48a 100644 --- a/t/t4034/javascript/expect +++ b/t/t4034/javascript/expect @@ -43,12 +43,30 @@ 0B0010 0b0001_1101_0011 0b11111111111111000011111111111111111n +// Floating point and exponent notation +3.14 +0.5 +1.23e3 +4.56e-2 +7.89E4 +0.12E-1 +5e2 +7e-3 +6E3 +9E-3 +3.15 +0.75 +1.23e4 +4.96e-3 +7.89E8 +0.11E-2 +6e3 +8e-2 +7E4 +2E-6 // punctuations -{ab} (ab) -ab; -[1,2,3] [1, 2, ...paramsparams_v2 ] a<==2 a>==2 a===2 a!==2 a====2 a!===2 a^==2 a=>=2 a+=-=b a*=%=b a**=&&=b a||=|=b b+-c a--++ a>><<b a>>>>>>=b a>>=<<=b -a&&&b a|||b a&&=??=b \ No newline at end of file +a&&&b a|||b a&&=??=b diff --git a/t/t4034/javascript/post b/t/t4034/javascript/post index 9d66c9dc91..12165198ad 100644 --- a/t/t4034/javascript/post +++ b/t/t4034/javascript/post @@ -22,12 +22,20 @@ 0B0010 0b0001_1101_0011 0b11111111111111000011111111111111111n +// Floating point and exponent notation +3.15 +0.75 +1.23e4 +4.96e-3 +7.89E8 +0.11E-2 +6e3 +8e-2 +7E4 +2E-6 // punctuations -{b} (b) -b; -[2,3] [ ...params_v2 ] a=2 a=2 a=2 a=2 a=2 a=2 a=2 a=2 a-=b a%=b a&&=b a|=b b-c a++ a<>>=b a<<=b -a&b a|b a??=b \ No newline at end of file +a&b a|b a??=b diff --git a/t/t4034/javascript/pre b/t/t4034/javascript/pre index 9876514042..43d5908e09 100644 --- a/t/t4034/javascript/pre +++ b/t/t4034/javascript/pre @@ -22,12 +22,20 @@ 0B0110 0b0001_1001_0011 0b1111111111111111111111111111111111111n +// Floating point and exponent notation +3.14 +0.5 +1.23e3 +4.56e-2 +7.89E4 +0.12E-1 +5e2 +7e-3 +6E3 +9E-3 // punctuations -{a} (a) -a; -[1,2] [ 1, 2, ...params ] a<=2 a>=2 a==2 a!=2 a===2 a!==2 a^=2 a=>2 a+=b a*=b a**=b a||=b b+c a-- a>>b a>>>b a>>=b -a&&b a||b a&&=b \ No newline at end of file +a&&b a||b a&&=b -- 2.50.0.rc0.62.g658f0ae201.dirty