mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-20 18:10:07 +00:00
Test case for #297
This commit is contained in:
parent
9286f5a3b1
commit
55209bfc5c
6 changed files with 26 additions and 13 deletions
1
go/regtest/cases/dsl-regex-matching/0016/cmd
Normal file
1
go/regtest/cases/dsl-regex-matching/0016/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr --oxtab put -f ${CASEDIR}/mlr regtest/input/regex-metacharacters.dkvp
|
||||
0
go/regtest/cases/dsl-regex-matching/0016/experr
Normal file
0
go/regtest/cases/dsl-regex-matching/0016/experr
Normal file
6
go/regtest/cases/dsl-regex-matching/0016/expout
Normal file
6
go/regtest/cases/dsl-regex-matching/0016/expout
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
input abc[.o*o.]def
|
||||
left abcLEFT.o*o.]def
|
||||
all ALLALLALLALLALLALLALLALLALLALLALLALLALL
|
||||
dot abc[DOTo*oDOT]def
|
||||
star abc[.oSTARo.]def
|
||||
right abc[.o*o.RIGHTdef
|
||||
5
go/regtest/cases/dsl-regex-matching/0016/mlr
Normal file
5
go/regtest/cases/dsl-regex-matching/0016/mlr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$left = gsub($input, "\[", "LEFT");
|
||||
$all = gsub($input, ".", "ALL");
|
||||
$dot = gsub($input, "\.", "DOT");
|
||||
$star = gsub($input, "\*", "STAR");
|
||||
$right = gsub($input, "\]", "RIGHT");
|
||||
1
go/regtest/input/regex-metacharacters.dkvp
Normal file
1
go/regtest/input/regex-metacharacters.dkvp
Normal file
|
|
@ -0,0 +1 @@
|
|||
input=abc[.o*o.]def
|
||||
26
go/todo.txt
26
go/todo.txt
|
|
@ -29,26 +29,26 @@ w discussion re docs6 ...
|
|||
----------------------------------------------------------------
|
||||
REGEX CAPTURES
|
||||
|
||||
! to do:
|
||||
* testing:
|
||||
|
||||
o testing:
|
||||
echo 'x=[.o*o.]' | mlr put '$y=gsub($x, "\[", "LEFT")'
|
||||
x=[.o*o.],y=LEFT.o*o.]
|
||||
|
||||
echo 'x=[.o*o.]' | mlr put '$y=gsub($x, "\[", "LEFT")'
|
||||
x=[.o*o.],y=LEFT.o*o.]
|
||||
echo 'x=[.o*o.]' | mlr put '$y=gsub($x, ".", "ALL")'
|
||||
x=[.o*o.],y=ALLALLALLALLALLALLALL
|
||||
|
||||
echo 'x=[.o*o.]' | mlr put '$y=gsub($x, ".", "ALL")'
|
||||
x=[.o*o.],y=ALLALLALLALLALLALLALL
|
||||
echo 'x=[.o*o.]' | mlr put '$y=gsub($x, "\.", "DOT")'
|
||||
x=[.o*o.],y=[DOTo*oDOT]
|
||||
|
||||
echo 'x=[.o*o.]' | mlr put '$y=gsub($x, "\.", "DOT")'
|
||||
x=[.o*o.],y=[DOTo*oDOT]
|
||||
echo 'x=[.o*o.]' | mlr put '$y=gsub($x, "\*", "STAR")'
|
||||
x=[.o*o.],y=[.oSTARo.]
|
||||
|
||||
echo 'x=[.o*o.]' | mlr put '$y=gsub($x, "\*", "STAR")'
|
||||
x=[.o*o.],y=[.oSTARo.]
|
||||
echo 'x=[.o*o.]' | mlr put '$y=sub($x, "\]", "RIGHT")'
|
||||
x=[.o*o.],y=[.o*o.RIGHT
|
||||
|
||||
echo 'x=[.o*o.]' | mlr put '$y=sub($x, "\]", "RIGHT")'
|
||||
x=[.o*o.],y=[.o*o.RIGHT
|
||||
* mlr put must not accept -x
|
||||
|
||||
o mlr put must not accept -x
|
||||
* torbiak informs x 2 commits
|
||||
|
||||
----------------------------------------------------------------
|
||||
DOC6
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue