From 4ef1423457af1284fde904803216514a34721f91 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 9 Jan 2014 14:26:18 +0100 Subject: allow column name override, add tests --- tests/it_pipe.t | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests') 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 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()"); -- cgit v1.2.3