mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
Avoid assuming ./mlr is the mlr to test (#876)
In test cases, support a ${MLR} placeholder for the mlr binary under
test, instead of assuming it's ./mlr (or its equivalent on platforms
not using forward slashes).
This ensures that wrapped mlr invocations all use the same binary,
either the default or the binary specified by the user, avoiding
surprises when ./mlr doesn't exist or is a different version.
Signed-off-by: Stephen Kitt <steve@sk2.org>
This commit is contained in:
parent
7ad53b0ce1
commit
af7bacf00e
8 changed files with 8 additions and 7 deletions
|
|
@ -773,6 +773,7 @@ func (regtester *RegTester) loadFile(
|
|||
contents := string(byteContents)
|
||||
contents = strings.ReplaceAll(contents, "${CASEDIR}", caseDir)
|
||||
contents = strings.ReplaceAll(contents, "${PATHSEP}", string(os.PathSeparator))
|
||||
contents = strings.ReplaceAll(contents, "${MLR}", regtester.exeName)
|
||||
return contents, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mlr --prepipe '.${PATHSEP}mlr cat' --odkvp join -j a -f test/input/join-het.dkvp test/input/abixy-het
|
||||
mlr --prepipe '${MLR} cat' --odkvp join -j a -f test/input/join-het.dkvp test/input/abixy-het
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mlr --odkvp join --prepipe '.${PATHSEP}mlr cat' -j a -f test/input/join-het.dkvp test/input/abixy-het
|
||||
mlr --odkvp join --prepipe '${MLR} cat' -j a -f test/input/join-het.dkvp test/input/abixy-het
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mlr --prepipe '.${PATHSEP}mlr cat' --odkvp join --prepipe cat -j a -f test/input/join-het.dkvp test/input/abixy-het
|
||||
mlr --prepipe '${MLR} cat' --odkvp join --prepipe cat -j a -f test/input/join-het.dkvp test/input/abixy-het
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mlr --csv --prepipe '.${PATHSEP}mlr --csv cat' cat test/input/rfc-csv/simple.csv-crlf
|
||||
mlr --csv --prepipe '${MLR} --csv cat' cat test/input/rfc-csv/simple.csv-crlf
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mlr --dkvp --prepipe '.${PATHSEP}mlr cat' cat test/input/abixy
|
||||
mlr --dkvp --prepipe '${MLR} cat' cat test/input/abixy
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mlr --csv --prepipe '.${PATHSEP}mlr --csv cat' cat < test/input/rfc-csv/simple.csv-crlf
|
||||
mlr --csv --prepipe '${MLR} --csv cat' cat < test/input/rfc-csv/simple.csv-crlf
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mlr --dkvp --prepipe '.${PATHSEP}mlr cat' cat < test/input/abixy
|
||||
mlr --dkvp --prepipe '${MLR} cat' cat < test/input/abixy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue