mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
New contains DSL function (#1374)
* New `contains` DSL function * unit-test files, and docs
This commit is contained in:
parent
5b29169b08
commit
5146dd7f90
11 changed files with 198 additions and 100 deletions
1
test/cases/dsl-contains/0001/cmd
Normal file
1
test/cases/dsl-contains/0001/cmd
Normal file
|
|
@ -0,0 +1 @@
|
|||
mlr -n put -q -f ${CASEDIR}/mlr
|
||||
0
test/cases/dsl-contains/0001/experr
Normal file
0
test/cases/dsl-contains/0001/experr
Normal file
8
test/cases/dsl-contains/0001/expout
Normal file
8
test/cases/dsl-contains/0001/expout
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
abc abc true
|
||||
abc true
|
||||
true
|
||||
abc false
|
||||
abcde abc true
|
||||
123 3 true
|
||||
123 34 false
|
||||
123 23 true
|
||||
14
test/cases/dsl-contains/0001/mlr
Normal file
14
test/cases/dsl-contains/0001/mlr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
end {
|
||||
for (e in [
|
||||
["abc", "abc"],
|
||||
["abc", ""],
|
||||
["", ""],
|
||||
["", "abc"],
|
||||
["abcde", "abc"],
|
||||
["123", 3],
|
||||
[123, 34],
|
||||
[123, 23],
|
||||
]) {
|
||||
print e[1], e[2], contains(e[1], e[2])
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue