From 63ca8dff7afff68f14bdb7e82dd877e8ec82c602 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Thu, 8 Dec 2016 19:02:02 -0500 Subject: [PATCH] split/join UT --- c/Makefile.no-autoconfig | 2 +- c/reg_test/expected/out | 123 +++++++++++++++++++++++++++++++++++++++ c/reg_test/run | 4 ++ c/todo.txt | 3 - 4 files changed, 128 insertions(+), 4 deletions(-) diff --git a/c/Makefile.no-autoconfig b/c/Makefile.no-autoconfig index 4e81b14ce..a9931937b 100644 --- a/c/Makefile.no-autoconfig +++ b/c/Makefile.no-autoconfig @@ -399,7 +399,7 @@ reg-test: # ---------------------------------------------------------------- # Run this after unit-test expected output has changed, and is verified to be # OK. (Example: after adding new test cases in test/run.) -regtest-copy: +regtest-copy taters: cp output-regtest/out reg_test/expected regtest-copy-dev: cp output-regtest/out-dev reg_test/expected diff --git a/c/reg_test/expected/out b/c/reg_test/expected/out index a8c0d117d..853daf5f4 100644 --- a/c/reg_test/expected/out +++ b/c/reg_test/expected/out @@ -46644,6 +46644,129 @@ i 10 x 0.5026260055412137 y 0.9526183602969864 +mlr --oxtab --from ./reg_test/input/abixy-het put s = joink({1:2, "abc":4, 5:"xyz"}, ":"); $* = splitnv(s, ":") +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +1 1 +2 abc +3 5 + +mlr --oxtab --from ./reg_test/input/abixy-het put s = joinv({1:2, "abc":4, 5:"xyz"}, ":"); $* = splitnv(s, ":") +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +1 2 +2 4 +3 xyz + +mlr --oxtab --from ./reg_test/input/abixy-het put s = joinkv({1:2, "abc":4, 5:"xyz"}, ":", ";"); $* = splitkv(s, ":", ";") +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + +1 2 +abc 4 +5 xyz + ================================================================ MAPVAR EMIT diff --git a/c/reg_test/run b/c/reg_test/run index 28e442588..df508074e 100755 --- a/c/reg_test/run +++ b/c/reg_test/run @@ -5457,6 +5457,10 @@ run_mlr --oxtab --from $indir/abixy-het put 's = joink($*, ":"); $* = splitnv(s, run_mlr --oxtab --from $indir/abixy-het put 's = joinv($*, ":"); $* = splitnv(s, ":")' run_mlr --oxtab --from $indir/abixy-het put 's = joinkv($*, ":", ";"); $* = splitkv(s, ":", ";")' +run_mlr --oxtab --from $indir/abixy-het put 's = joink({1:2, "abc":4, 5:"xyz"}, ":"); $* = splitnv(s, ":")' +run_mlr --oxtab --from $indir/abixy-het put 's = joinv({1:2, "abc":4, 5:"xyz"}, ":"); $* = splitnv(s, ":")' +run_mlr --oxtab --from $indir/abixy-het put 's = joinkv({1:2, "abc":4, 5:"xyz"}, ":", ";"); $* = splitkv(s, ":", ";")' + # ---------------------------------------------------------------- announce MAPVAR EMIT diff --git a/c/todo.txt b/c/todo.txt index c42663ecb..ac7ed9773 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -222,9 +222,6 @@ SYNTAX ERROR IMPROVEMENT: ================================================================ UT FOR 5.0.0: -* joink joinv joinkv splitnv splitkv test in various contexts esp free-and-replace. -* joink joinv joinkv splitnv splitkv memmgt / valgrinds ! - * all assert_X() cases * all type-decl cases: local/forbind/argpass; initial assign & reuse thereafter.