summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorUrban Müller2014-01-09 14:26:18 +0100
committerUrban Müller2014-01-09 14:26:18 +0100
commit4ef1423457af1284fde904803216514a34721f91 (patch)
treeda068761d4979f5927837ab26922d1ca883c976e /tests
parent6022d924c7ac70a13d1782f2f1199f9ef45c947c (diff)
downloaditools-4ef1423457af1284fde904803216514a34721f91.tar.gz
itools-4ef1423457af1284fde904803216514a34721f91.tar.bz2
itools-4ef1423457af1284fde904803216514a34721f91.zip
allow column name override, add tests
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it_pipe.t10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/it_pipe.t b/tests/it_pipe.t
index c65073d..ce55469 100755
--- a/tests/it_pipe.t
+++ b/tests/it_pipe.t
@@ -1,7 +1,9 @@
#!/www/server/bin/php
<?php
-is(json_encode((new it_pipe('data' => array("a\tb", "1\t2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
-is(json_encode((new it_pipe('data' => array("a;b", "1;2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
-is(json_encode((new it_pipe('data' => array("a,b", "1,2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
-is(json_encode((new it_pipe('data' => array("a\tb", "1\t2")))->csv("c,d")), '[{"c":"1","d":"2"}]', "it_pipe::csv()");
+# csv()
+is(json_encode((new it_pipe('data' => array("a\tb", "1\t2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
+is(json_encode((new it_pipe('data' => array("a;b", "1;2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
+is(json_encode((new it_pipe('data' => array("a,b", "1,2")))->csv()), '[{"a":"1","b":"2"}]', "it_pipe::csv()");
+is(json_encode((new it_pipe('data' => array("a\tb", "1\t2")))->csv("c,d")), '[{"c":"1","d":"2"}]', "it_pipe::csv()");
+is(json_encode((new it_pipe('data' => array("\t", "1\t2")))->csv()), '[{"field0":"1","field1":"2"}]', "it_pipe::csv()");