aboutsummaryrefslogtreecommitdiffstats
path: root/test/regexsub.ok
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-08-26 22:01:10 +0300
committerArnold D. Robbins <arnold@skeeve.com>2021-08-26 22:01:10 +0300
commit340b2837d42b956dbf9d34f9a66c674bb62ca377 (patch)
tree5ff147390f457eebc06628bcca06cb6d7c59d0c9 /test/regexsub.ok
parent251db3795ba7dc4054c2df486c0e0e91e0b28f58 (diff)
parent585a9456283db7169ea53a328824e55deb998d8f (diff)
downloadegawk-340b2837d42b956dbf9d34f9a66c674bb62ca377.tar.gz
egawk-340b2837d42b956dbf9d34f9a66c674bb62ca377.tar.bz2
egawk-340b2837d42b956dbf9d34f9a66c674bb62ca377.zip
Merge branch 'gawk-5.1-stable'
Diffstat (limited to 'test/regexsub.ok')
-rw-r--r--test/regexsub.ok30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/regexsub.ok b/test/regexsub.ok
new file mode 100644
index 00000000..44511ebc
--- /dev/null
+++ b/test/regexsub.ok
@@ -0,0 +1,30 @@
+Initialize strong regex
+Test gsub on strong regex
+rgx1 = '[abc]' typeof(rgx1) = 'regexp'
+rgx2 = '[abc]' typeof(rgx2) = 'regexp'
+Test gsub() a strong regex
+rgx1 = '[abc]' typeof(rgx1) = 'regexp'
+rgx2 = '[aec]' typeof(rgx2) = 'regexp'
+Test value not found in regex
+rgx1 = '[abc]' typeof(rgx1) = 'regexp'
+Test gsub on numbers
+v1 = '12345' typeof(v1) = 'number'
+v2 = '12345' typeof(v2) = 'number'
+v1 = '12345' typeof(v1) = 'number'
+v2 = '12x45' typeof(v2) = 'string'
+Test value not found in number
+v1 = '12345' typeof(v1) = 'number'
+Test gensub on regex
+a = @/abc/ typeof(a) = 'regexp'
+c = "axc" typeof(c) = 'string'
+Test value not found in regex
+b = @/abc/ typeof(b) = 'regexp'
+c = "abc" typeof(c) = 'string'
+Test gensub on numbers
+a = "12345" typeof(a) = 'number'
+b = "12345" typeof(b) = 'number'
+c = "12x45" typeof(c) = 'string'
+Test value not found in number
+b = "12345" typeof(b) = 'number'
+c = "12345" typeof(c) = 'string'
+string 12345