treat zero as non-empty spark value
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 13 Nov 2022 14:17:09 +0000 (15:17 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 18 Nov 2022 00:25:46 +0000 (01:25 +0100)
barcat
t/t2110-spark_binary.in [changed from symlink to file mode: 0644]
t/t2110-spark_binary_--spark_--indicators=XO.out
t/t2111-spark_unicode.in
t/t2111-spark_unicode_--spark_--indicators=-·•O.out
t/t2115-spark-oneliner_--spark_--indicators=1.out
t/t2180-spark_combined.in
t/t2180-spark_combined_--spark_--indicators=012345_-cs_--maxval=1_-L17.out

diff --git a/barcat b/barcat
index b939ea95ae88a91ddd0fe89b2017ecb1ae77259d..4d3205ff3aec082d3741083e8c438902e45aeb52 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -291,7 +291,7 @@ while ($nr <= $limit) {
                $val == $order[-1] ? $opt{palette}->[0] : # min
                $opt{palette}->[ $rel * ($#{$opt{palette}} - 1) + 1 ];
        my $indicator = $opt{indicators} && $opt{indicators}->[
-               !$val || !$#{$opt{indicators}} ? 0 : # blank
+               !length($val) || !$#{$opt{indicators}} ? 0 : # blank
                $#{$opt{indicators}} < 2 ? 1 :
                $val >= $order[0] ? -1 :
                $rel * ($#{$opt{indicators}} - 1e-14) + 1
deleted file mode 120000 (symlink)
index dcd72c5f0f9185aaff0ffdda03721175a7883e7d..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-t1005-float.in
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..3252be5cba3cf62e4832b52398a9ae92e29d7c2a
--- /dev/null
@@ -0,0 +1,15 @@
+header:
+-2
+1
+2
+0
+not 0
+0 again
+3
+
+8
+3
+.9
+1
+empty
+
index d25d0bdfd61c27c27d5c1f3b9fce5af666a5c01d..753f76c13732f892640bae3f05c2c59a5ac89d88 100644 (file)
@@ -1 +1 @@
-OOOOXOOOOOOOOOXOOX
+XOOOOXOOXOOOOXX
index dcd72c5f0f9185aaff0ffdda03721175a7883e7d..cb5106f243cdaef76b2d37444b15c19291b87a77 120000 (symlink)
@@ -1 +1 @@
-t1005-float.in
\ No newline at end of file
+t2110-spark_binary.in
\ No newline at end of file
index 854d335f2f6130c8f9904932562363004a56303a..6662c526e032eb3576acbe168b2b684d9bdfc416 100644 (file)
@@ -1 +1 @@
-···•-•••••••OO-O·-
+-··•·-·•-O•··--
index 60d426865cb9a25bf3e2bc731e5daa16acacee26..86eb132b155142a620b981dc78b7a38e51ee2d23 100644 (file)
@@ -1 +1 @@
-111111111111111111
+111111111111111
index cb5106f243cdaef76b2d37444b15c19291b87a77..dcd72c5f0f9185aaff0ffdda03721175a7883e7d 120000 (symlink)
@@ -1 +1 @@
-t2110-spark_binary.in
\ No newline at end of file
+t1005-float.in
\ No newline at end of file
index 777e01533e930666e176bdcc7cddb247590e6827..be3a08be5147570309679ddda402d3b551826442 100644 (file)
@@ -1,2 +1,2 @@
-\e[31m1\e[90m1\e[90m2\e[90m3\e[90m0\e[90m4\e[90m4\e[90m4\e[90m4\e[90m4\e[90m3\e[90m4\e[32m5\e[32m50\e[32m5\e[90m2\e[0m
+\e[31m1\e[90m1\e[90m2\e[90m3\e[90m4\e[90m4\e[90m4\e[90m4\e[90m4\e[90m4\e[90m3\e[90m4\e[32m5\e[32m50\e[32m5\e[90m2\e[0m
 -7.459 of \e[1m-7.459\e[0m total in 16 values over 18 lines (\e[31m-3\e[0m min, \e[36m-0.47\e[0m avg, \e[32m2\e[0m max)