From: "Derick W. de M. Frias" <derick.william.moraes@gmail.com>
To: j6t@kdbg.org
Cc: derick.william.moraes@gmail.com, git@vger.kernel.org
Subject: [PATCH v2 2/4] t4034: add tests for javascript word literals
Date: Mon, 23 Jun 2025 03:35:47 -0300 [thread overview]
Message-ID: <20250623090538.154858-3-derick.william.moraes@gmail.com> (raw)
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 <derick.william.moraes@gmail.com>
---
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
next prev parent reply other threads:[~2025-06-23 9:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-04 9:35 [GSoC PATCH 0/1] userdiff: add javascript diff driver Derick W. de M. Frias
2025-06-04 9:35 ` [GSoC PATCH 1/1] " Derick W. de M. Frias
2025-06-04 21:19 ` D. Ben Knoble
2025-06-05 5:51 ` Johannes Sixt
2025-06-23 6:35 ` [PATCH v2 0/4] diff: create pattern for javascript language Derick W. de M. Frias
2025-06-23 6:35 ` [PATCH v2 1/4] userdiff: add javascript diff driver Derick W. de M. Frias
2025-06-23 18:09 ` Junio C Hamano
2025-06-23 6:35 ` Derick W. de M. Frias [this message]
2025-06-23 6:35 ` [PATCH v2 3/4] t4018: add tests for recognizing javascript function syntax Derick W. de M. Frias
2025-06-23 6:35 ` [PATCH v2 4/4] t4018: add tests for javascript export type function declarations Derick W. de M. Frias
2025-06-26 6:21 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250623090538.154858-3-derick.william.moraes@gmail.com \
--to=derick.william.moraes@gmail.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).