regression tests

This commit is contained in:
John Kerl 2022-01-13 09:28:46 -05:00
parent 49e551c794
commit e53dee0871
48 changed files with 71 additions and 2 deletions

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

@ -0,0 +1 @@
mlr: function unformat invoked with 0 arguments; expected 2

View file

View file

@ -0,0 +1,3 @@
end {
print unformat()
}

View file

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
(error)

View file

@ -0,0 +1,3 @@
end {
print unformat(1, 2)
}

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
(error)

View file

@ -0,0 +1,3 @@
end {
print unformat("12m34s", "{}:{}")
}

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
[1, 2]

View file

@ -0,0 +1,3 @@
end {
print unformat("{}:{}", "1:2")
}

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
(error)

View file

@ -0,0 +1,3 @@
end {
print unformat("{}:{}", "1")
}

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
[1, ""]

View file

@ -0,0 +1,3 @@
end {
print unformat("{}:{}", "1:")
}

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
[1, 2]

View file

@ -0,0 +1,3 @@
end {
print unformat("{}:{}", "1:2")
}

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
[1, "2:3"]

View file

@ -0,0 +1,3 @@
end {
print unformat("{}:{}", "1:2:3")
}

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

@ -0,0 +1,11 @@
mlr: cannot parse DSL expression.
Parse error on token ""<abc:defi)
" at line 2 column 29.
Expected one of:
{ ( ) field_name $[ braced_field_name $[[ $[[[ full_srec oosvar_name @[
braced_oosvar_name full_oosvar all non_sigil_name float int + - .+ .- !
~ string_literal regex_case_insensitive int_literal float_literal boolean_literal
null_literal const_M_PI const_M_E panic [ ctx_IPS ctx_IFS ctx_IRS ctx_OPS
ctx_OFS ctx_ORS ctx_FLATSEP ctx_NF ctx_NR ctx_FNR ctx_FILENAME ctx_FILENUM
env func

View file

View file

@ -0,0 +1,3 @@
end {
print unformat("<{}:{}>", "<abc:defi)
}

View file

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
[5, 18, 47, 22]

View file

@ -0,0 +1,3 @@
end {
print unformat("{}-{}:{}:{}", "5-18:47:22")
}

View file

@ -0,0 +1 @@
mlr -n put -f ${CASEDIR}/mlr

View file

View file

@ -0,0 +1 @@
["5", "18", "47", "22"]

View file

@ -0,0 +1,3 @@
end {
print unformatx("{}-{}:{}:{}", "5-18:47:22")
}

View file

@ -0,0 +1 @@
print unformat("{}:{}", "1")

View file

@ -6,12 +6,15 @@ RELEASES
================================================================
FEATURES
k better print-interpolate with {} etc
! Better functions for values manipulation, e.g. easier conversion of strings like "$1,234.56" into numeric values
o note on is_error(x) (or string(x) == "(error)")
? dhms w/ optional separgs -- ? what about fenceposting? ["d","h","m","s"] vs ["-",":",":",""] -- ?
o 'Ability to specify some formats that are fixed. Like we can process
"5d18h53m20s" format in *dhms* commands, but what about "5-18:53:20"? This is
a common format used by the SLURM resource manager.'
o generalize dhms w/ sscanf-style something -- ?
o linked-to faqent w/ -f -s etc ...
o ... AND, if it's frequent then submit a feature request b/c other people probably also would like it! :)
k better print-interpolate with {} etc
! sysdate, sysdate_local; datediff ...
! strmatch https://github.com/johnkerl/miller/issues/77#issuecomment-538790927
! sliding window / moving average