From: Michael Wallner Date: Wed, 5 Jan 2022 22:14:58 +0000 (+0100) Subject: tests++ X-Git-Tag: v0.1.0~47 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d31afba7b6dc66b25f6070b5fc5195e4a1c8a85c;p=awesomized%2Fext-ion tests++ --- diff --git a/tests/LOB.phpt b/tests/LOB.phpt new file mode 100644 index 0000000..f9855d3 --- /dev/null +++ b/tests/LOB.phpt @@ -0,0 +1,21 @@ +--TEST-- +ion\LOB +--EXTENSIONS-- +ion +--FILE-- +TEST + +DONE +--EXPECTF-- +TEST +{{"foobar"}} +{{"barfuz"}} +{{Z29vemE=}} +DONE diff --git a/tests/Reader/Stream.phpt b/tests/Reader/Stream.phpt new file mode 100644 index 0000000..c856437 --- /dev/null +++ b/tests/Reader/Stream.phpt @@ -0,0 +1,36 @@ +--TEST-- +ion\Reader\Stream +--EXTENSIONS-- +ion +--FILE-- +TEST +next(); +var_dump($r->readDecimal()); +?> +DONE +--EXPECTF-- +TEST +int(5) +object(ion\Decimal)#2 (2) { + ["number"]=> + int(123) + ["context"]=> + object(ion\Decimal\Context)#3 (5) { + ["digits"]=> + int(999999999) + ["eMax"]=> + int(999999999) + ["eMin"]=> + int(-999999999) + ["round"]=> + int(3) + ["clamp"]=> + bool(false) + } +} +DONE diff --git a/tests/Writer/Buffer.phpt b/tests/Writer/Buffer.phpt new file mode 100644 index 0000000..aaa5b01 --- /dev/null +++ b/tests/Writer/Buffer.phpt @@ -0,0 +1,21 @@ +--TEST-- +ion\Writer\Buffer +--EXTENSIONS-- +ion +--FILE-- +TEST +writeTypedNull(ion\Type::Int); +var_dump($buf === $w->getBuffer()); +$w->finish(); +echo $buf; +?> + +DONE +--EXPECTF-- +TEST +bool(true) +null.int%r( null.int)*%r +DONE diff --git a/tests/Writer/Stream.phpt b/tests/Writer/Stream.phpt new file mode 100644 index 0000000..5b41194 --- /dev/null +++ b/tests/Writer/Stream.phpt @@ -0,0 +1,21 @@ +--TEST-- +ion\Writer\Stream +--EXTENSIONS-- +ion +--FILE-- +TEST +writeTypedNull(ion\Type::Int); +var_dump(STDOUT === $w->getStream()); +$w->finish(); + +?> + +DONE +--EXPECTF-- +TEST +bool(true) +null.int +DONE