Subject: [PATCH v2 2/4] t4034: add tests for javascript word literals

From: "Derick W. de M. Frias" <[email-masked]>
Date: Mon, 23 Jun 2025 03:35:47 -0300

Add tests for javascript word pattern.

Signed-off-by: Derick W. de M. Frias <[email-masked]>
---
 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 @@
 <GREEN>0B0010<RESET>
 <GREEN>0b0001_1101_0011<RESET>
 <GREEN>0b11111111111111000011111111111111111n<RESET>
+// Floating point and exponent notation<RESET>
+<RED>3.14<RESET>
+<RED>0.5<RESET>
+<RED>1.23e3<RESET>
+<RED>4.56e-2<RESET>
+<RED>7.89E4<RESET>
+<RED>0.12E-1<RESET>
+<RED>5e2<RESET>
+<RED>7e-3<RESET>
+<RED>6E3<RESET>
+<RED>9E-3<RESET>
+<GREEN>3.15<RESET>
+<GREEN>0.75<RESET>
+<GREEN>1.23e4<RESET>
+<GREEN>4.96e-3<RESET>
+<GREEN>7.89E8<RESET>
+<GREEN>0.11E-2<RESET>
+<GREEN>6e3<RESET>
+<GREEN>8e-2<RESET>
+<GREEN>7E4<RESET>
+<GREEN>2E-6<RESET>
 // punctuations<RESET>
-{<RED>a<RESET><GREEN>b<RESET>} (<RED>a<RESET><GREEN>b<RESET>)
-<RED>a<RESET><GREEN>b<RESET>;
-[<RED>1,<RESET>2<GREEN>,3<RESET>]
 [<RED>1, 2,<RESET> ...<RED>params<RESET><GREEN>params_v2<RESET> ]
 a<RED><=<RESET><GREEN>=<RESET>2 a<RED>>=<RESET><GREEN>=<RESET>2 a<RED>==<RESET><GREEN>=<RESET>2 a<RED>!=<RESET><GREEN>=<RESET>2 a<RED>===<RESET><GREEN>=<RESET>2 a<RED>!==<RESET><GREEN>=<RESET>2 a<RED>^=<RESET><GREEN>=<RESET>2 a<RED>=><RESET><GREEN>=<RESET>2
 a<RED>+=<RESET><GREEN>-=<RESET>b a<RED>*=<RESET><GREEN>%=<RESET>b a<RED>**=<RESET><GREEN>&&=<RESET>b a<RED>||=<RESET><GREEN>|=<RESET>b
 b<RED>+<RESET><GREEN>-<RESET>c a<RED>--<RESET><GREEN>++<RESET> a<RED>>><RESET><GREEN><<<RESET>b a<RED>>>><RESET><GREEN>>>>=<RESET>b a<RED>>>=<RESET><GREEN><<=<RESET>b
-a<RED>&&<RESET><GREEN>&<RESET>b a<RED>||<RESET><GREEN>|<RESET>b a<RED>&&=<RESET><GREEN>??=<RESET>b
\ No newline at end of file
+a<RED>&&<RESET><GREEN>&<RESET>b a<RED>||<RESET><GREEN>|<RESET>b a<RED>&&=<RESET><GREEN>??=<RESET>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 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