summaryrefslogtreecommitdiff
path: root/tests/it_pipe.t
blob: c65073d8e7d5730f789d0f3bb732029dcb9726b5 (plain)
1
2
3
4
5
6
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()");