From d31afba7b6dc66b25f6070b5fc5195e4a1c8a85c Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 5 Jan 2022 23:14:58 +0100 Subject: [PATCH] tests++ --- tests/LOB.phpt | 21 +++++++++++++++++++++ tests/Reader/Stream.phpt | 36 ++++++++++++++++++++++++++++++++++++ tests/Writer/Buffer.phpt | 21 +++++++++++++++++++++ tests/Writer/Stream.phpt | 21 +++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 tests/LOB.phpt create mode 100644 tests/Reader/Stream.phpt create mode 100644 tests/Writer/Buffer.phpt create mode 100644 tests/Writer/Stream.phpt 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 -- 2.30.2