diff options
-rwxr-xr-x | tests/it_pipe.t | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/it_pipe.t b/tests/it_pipe.t new file mode 100755 index 0000000..c65073d --- /dev/null +++ b/tests/it_pipe.t @@ -0,0 +1,7 @@ +#!/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()"); |