summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristian Schneider2020-01-20 13:48:36 +0100
committerChristian Schneider2020-01-20 13:48:36 +0100
commite9140b4736c79aeff8c98b9e251418047fe12f46 (patch)
treefd51ba4c84eee58f573dd610b79e8e2a22f15b69 /test
parent4e96426bdb7a46e2d65077461495af034ae65e4d (diff)
downloaditools-e9140b4736c79aeff8c98b9e251418047fe12f46.tar.gz
itools-e9140b4736c79aeff8c98b9e251418047fe12f46.tar.bz2
itools-e9140b4736c79aeff8c98b9e251418047fe12f46.zip
Support all arguments of file_get_contents, including maxlen
Diffstat (limited to 'test')
-rwxr-xr-xtest/it.t13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/it.t b/test/it.t
index cc3e9f2..26d0f95 100755
--- a/test/it.t
+++ b/test/it.t
@@ -470,13 +470,16 @@ is(it::split("(b)", "aba", ['delim_capture' => true]), ["a", "b", "a"]);
is(it::split("b", "aabaa", ['offset_capture' => true]), [["aa", 0], ["aa", 3]]);
$tmpfile = tempnam("/tmp", "it_test");
-it::file_put_contents($tmpfile, "aa");
-is(($fh = it::fopen($tmpfile, "r")) ? fgets($fh) : null, "aa");
-is(it::file_get_contents($tmpfile), "aa");
-is(it::file($tmpfile), ["aa"]);
+it::file_put_contents($tmpfile, "abc");
+is(($fh = it::fopen($tmpfile, "r")) ? fgets($fh) : null, "abc");
+is(it::file_get_contents($tmpfile), "abc");
+is(it::file_get_contents($tmpfile, false, null, 1), "bc");
+is(it::file_get_contents($tmpfile, false, null, 0, 2), "ab");
+is(it::file_get_contents($tmpfile, false, null, 1, 1), "b");
+is(it::file($tmpfile), ["abc"]);
ob_start();
it::readfile($tmpfile);
-is(ob_get_clean(), "aa");
+is(ob_get_clean(), "abc");
it::file_put($tmpfile, "bb");
is(it::file_get($tmpfile), "bb");