aboutsummaryrefslogtreecommitdiffstats
path: root/skate/zipkey
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-06-15 05:02:41 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-06-15 05:02:41 +0200
commit6cafbfc870d2f0820534018c02b4dc12dbb06510 (patch)
treea2f9b9c51b10488511121081798d2736add093a8 /skate/zipkey
parent68bbcf0d299ed6b402381fd31348c9c77908831f (diff)
downloadrefcat-6cafbfc870d2f0820534018c02b4dc12dbb06510.tar.gz
refcat-6cafbfc870d2f0820534018c02b4dc12dbb06510.zip
zipkey: fix test cases
Diffstat (limited to 'skate/zipkey')
-rw-r--r--skate/zipkey/testdata/c0c4
-rw-r--r--skate/zipkey/testdata/c1c4
-rw-r--r--skate/zipkey/testdata/c3c2
-rw-r--r--skate/zipkey/testdata/c4c2
-rw-r--r--skate/zipkey/zipkey.go5
5 files changed, 9 insertions, 8 deletions
diff --git a/skate/zipkey/testdata/c0c b/skate/zipkey/testdata/c0c
index 3a3ea49..11d383b 100644
--- a/skate/zipkey/testdata/c0c
+++ b/skate/zipkey/testdata/c0c
@@ -1,2 +1,2 @@
-{"Key":"","G0":["k1 b\n"],"G1":["k1 B\n"]}
-{"Key":"","G0":["k3 d\n"],"G1":["k3 D\n"]} \ No newline at end of file
+{"Key":"k1","G0":["k1 b\n"],"G1":["k1 B\n"]}
+{"Key":"k3","G0":["k3 d\n"],"G1":["k3 D\n"]} \ No newline at end of file
diff --git a/skate/zipkey/testdata/c1c b/skate/zipkey/testdata/c1c
index d108667..4bd063d 100644
--- a/skate/zipkey/testdata/c1c
+++ b/skate/zipkey/testdata/c1c
@@ -1,2 +1,2 @@
-{"Key":"","G0":["1 a\n","1 a\n","1 a\n","1 a\n","1 a\n","1 a\n","1 a\n","1 a\n"],"G1":["1 A\n"]}
-{"Key":"","G0":["2 b\n","2 b\n","2 b\n","2 b\n","2 b\n"],"G1":["2 B\n"]} \ No newline at end of file
+{"Key":"1","G0":["1 a\n","1 a\n","1 a\n","1 a\n","1 a\n","1 a\n","1 a\n","1 a\n"],"G1":["1 A\n"]}
+{"Key":"2","G0":["2 b\n","2 b\n","2 b\n","2 b\n","2 b\n"],"G1":["2 B\n"]} \ No newline at end of file
diff --git a/skate/zipkey/testdata/c3c b/skate/zipkey/testdata/c3c
index eaabdad..bbca26f 100644
--- a/skate/zipkey/testdata/c3c
+++ b/skate/zipkey/testdata/c3c
@@ -1 +1 @@
-{"Key":"","G0":["2 1\n","2 2\n","2 3\n","2 4\n","2 5\n"],"G1":["2 a\n","2 b\n","2 c\n","2 d\n","2 e\n"]} \ No newline at end of file
+{"Key":"2","G0":["2 1\n","2 2\n","2 3\n","2 4\n","2 5\n"],"G1":["2 a\n","2 b\n","2 c\n","2 d\n","2 e\n"]} \ No newline at end of file
diff --git a/skate/zipkey/testdata/c4c b/skate/zipkey/testdata/c4c
index 4cf2f92..3b33dab 100644
--- a/skate/zipkey/testdata/c4c
+++ b/skate/zipkey/testdata/c4c
@@ -1 +1 @@
-{"Key":"","G0":["a k0 a\n","a k0 a\n","a k0 a\n","a k0 a\n"],"G1":["b k0 b\n","b k0 b\n","b k0 b\n","b k0 b\n"]}
+{"Key":"k0","G0":["a k0 a\n","a k0 a\n","a k0 a\n","a k0 a\n"],"G1":["b k0 b\n","b k0 b\n","b k0 b\n","b k0 b\n"]}
diff --git a/skate/zipkey/zipkey.go b/skate/zipkey/zipkey.go
index aa49983..804ffa0 100644
--- a/skate/zipkey/zipkey.go
+++ b/skate/zipkey/zipkey.go
@@ -85,8 +85,9 @@ func (c *ZipRun) Run() error {
}
case k0 == k1:
g := &Group{
- G0: []string{c0},
- G1: []string{c1},
+ Key: k0,
+ G0: []string{c0},
+ G1: []string{c1},
}
for {
c0, err = c.r0.ReadString(c.sep)