mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 04:30:56 +01:00
Release v1.0.17 (#9)
* add shortcut -H to --no-headers, it's too cumbersome to type * added fuzzy search support * Added basic lisp plugin facilities * Lisp plugin Addidions: - added process hook facilities - added working example lisp plugin for filter hook - load-path can now be a file as well - added a couple of lisp helper functions (atoi, split), more may follow, see lisplib.go * linting fixes
This commit is contained in:
10
t/plugintest.zy
Normal file
10
t/plugintest.zy
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
Simple filter hook function. Splits the argument by whitespace,
|
||||
fetches the 2nd element, converts it to an int and returns true
|
||||
if it s larger than 5, false otherwise.
|
||||
*/
|
||||
(defn uselarge [line]
|
||||
(cond (> (atoi (second (resplit line `\s+`))) 5) true false))
|
||||
|
||||
/* Register the filter hook */
|
||||
(addhook %filter %uselarge)
|
||||
12
t/test.sh
12
t/test.sh
@@ -30,14 +30,14 @@ cd $(dirname $0)
|
||||
echo "Executing commandline tests ..."
|
||||
|
||||
# io pattern tests
|
||||
ex io-pattern-and-file $t bk7 testtable.kube
|
||||
cat testtable.kube | ex io-pattern-and-stdin $t bk7
|
||||
cat testtable.kube | ex io-pattern-and-stdin-dash $t bk7 -
|
||||
ex io-pattern-and-file $t bk7 testtable
|
||||
cat testtable | ex io-pattern-and-stdin $t bk7
|
||||
cat testtable | ex io-pattern-and-stdin-dash $t bk7 -
|
||||
|
||||
# same w/o pattern
|
||||
ex io-just-file $t testtable.kube
|
||||
cat testtable.kube | ex io-just-stdin $t
|
||||
cat testtable.kube | ex io-just-stdin-dash $t -
|
||||
ex io-just-file $t testtable
|
||||
cat testtable | ex io-just-stdin $t
|
||||
cat testtable | ex io-just-stdin-dash $t -
|
||||
|
||||
if test $fail -ne 0; then
|
||||
echo "!!! Some tests failed !!!"
|
||||
|
||||
6
t/testtable2
Normal file
6
t/testtable2
Normal file
@@ -0,0 +1,6 @@
|
||||
NAME DURATION
|
||||
x 10
|
||||
a 100
|
||||
z 0
|
||||
u 4
|
||||
k 6
|
||||
Reference in New Issue
Block a user