aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/src/SpecTestsuites/Core/UnreachedValidTest.php
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-04-28 11:02:51 +0900
committernsfisis <nsfisis@gmail.com>2024-04-28 17:38:19 +0900
commit88a77bc5846541e5d6009bc103da378650a649f3 (patch)
treeef4d3a57cc16bf230c3ac25068001f747e45b35e /tests/src/SpecTestsuites/Core/UnreachedValidTest.php
parentc809cd661bba388d531f24c2ac578fbe6594f45c (diff)
downloadphp-waddiwasi-88a77bc5846541e5d6009bc103da378650a649f3.tar.gz
php-waddiwasi-88a77bc5846541e5d6009bc103da378650a649f3.tar.zst
php-waddiwasi-88a77bc5846541e5d6009bc103da378650a649f3.zip
test: generate PHPUnit classes from WAST files
Diffstat (limited to 'tests/src/SpecTestsuites/Core/UnreachedValidTest.php')
-rw-r--r--tests/src/SpecTestsuites/Core/UnreachedValidTest.php85
1 files changed, 85 insertions, 0 deletions
diff --git a/tests/src/SpecTestsuites/Core/UnreachedValidTest.php b/tests/src/SpecTestsuites/Core/UnreachedValidTest.php
new file mode 100644
index 0000000..b5f279f
--- /dev/null
+++ b/tests/src/SpecTestsuites/Core/UnreachedValidTest.php
@@ -0,0 +1,85 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Nsfisis\Waddiwasi\Tests\SpecTestsuites\Core;
+
+use Nsfisis\Waddiwasi\Tests\SpecTestsuites\SpecTestsuiteBase;
+use PHPUnit\Framework\Attributes\Depends;
+
+final class UnreachedValidTest extends SpecTestsuiteBase
+{
+ public function testModule0(): void
+ {
+ $this->runModuleCommand(
+ filename: 'unreached-valid.0.wasm',
+ name: null,
+ line: 1,
+ );
+ }
+
+ #[Depends('testModule0')]
+ public function testAssertTrap1(): void
+ {
+ $this->runAssertTrapCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'select-trap-left', 'args' => [['type' => 'i32', 'value' => '1']]],
+ text: 'unreachable',
+ line: 42,
+ );
+ }
+
+ #[Depends('testAssertTrap1')]
+ public function testAssertTrap2(): void
+ {
+ $this->runAssertTrapCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'select-trap-left', 'args' => [['type' => 'i32', 'value' => '0']]],
+ text: 'unreachable',
+ line: 43,
+ );
+ }
+
+ #[Depends('testAssertTrap2')]
+ public function testAssertTrap3(): void
+ {
+ $this->runAssertTrapCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'select-trap-right', 'args' => [['type' => 'i32', 'value' => '1']]],
+ text: 'unreachable',
+ line: 44,
+ );
+ }
+
+ #[Depends('testAssertTrap3')]
+ public function testAssertTrap4(): void
+ {
+ $this->runAssertTrapCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'select-trap-right', 'args' => [['type' => 'i32', 'value' => '0']]],
+ text: 'unreachable',
+ line: 45,
+ );
+ }
+
+ #[Depends('testAssertTrap4')]
+ public function testModule5(): void
+ {
+ $this->runModuleCommand(
+ filename: 'unreached-valid.1.wasm',
+ name: null,
+ line: 49,
+ );
+ }
+
+ #[Depends('testModule5')]
+ public function testAssertTrap6(): void
+ {
+ $this->runAssertTrapCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'meet-bottom', 'args' => []],
+ text: 'unreachable',
+ line: 63,
+ );
+ }
+}