aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/src/SpecTestsuites/Core/StackTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/SpecTestsuites/Core/StackTest.php')
-rw-r--r--tests/src/SpecTestsuites/Core/StackTest.php85
1 files changed, 85 insertions, 0 deletions
diff --git a/tests/src/SpecTestsuites/Core/StackTest.php b/tests/src/SpecTestsuites/Core/StackTest.php
new file mode 100644
index 0000000..9e4377f
--- /dev/null
+++ b/tests/src/SpecTestsuites/Core/StackTest.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 StackTest extends SpecTestsuiteBase
+{
+ public function testModule0(): void
+ {
+ $this->runModuleCommand(
+ filename: 'stack.0.wasm',
+ name: null,
+ line: 1,
+ );
+ }
+
+ #[Depends('testModule0')]
+ public function testAssertReturn1(): void
+ {
+ $this->runAssertReturnCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'fac-expr', 'args' => [['type' => 'i64', 'value' => '25']]],
+ expected: [['type' => 'i64', 'value' => '7034535277573963776']],
+ line: 146,
+ );
+ }
+
+ #[Depends('testAssertReturn1')]
+ public function testAssertReturn2(): void
+ {
+ $this->runAssertReturnCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'fac-stack', 'args' => [['type' => 'i64', 'value' => '25']]],
+ expected: [['type' => 'i64', 'value' => '7034535277573963776']],
+ line: 147,
+ );
+ }
+
+ #[Depends('testAssertReturn2')]
+ public function testAssertReturn3(): void
+ {
+ $this->runAssertReturnCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'fac-mixed', 'args' => [['type' => 'i64', 'value' => '25']]],
+ expected: [['type' => 'i64', 'value' => '7034535277573963776']],
+ line: 148,
+ );
+ }
+
+ #[Depends('testAssertReturn3')]
+ public function testAssertReturn4(): void
+ {
+ $this->runAssertReturnCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'not-quite-a-tree', 'args' => []],
+ expected: [['type' => 'i32', 'value' => '3']],
+ line: 150,
+ );
+ }
+
+ #[Depends('testAssertReturn4')]
+ public function testAssertReturn5(): void
+ {
+ $this->runAssertReturnCommand(
+ module: null,
+ action: ['type' => 'invoke', 'field' => 'not-quite-a-tree', 'args' => []],
+ expected: [['type' => 'i32', 'value' => '9']],
+ line: 151,
+ );
+ }
+
+ #[Depends('testAssertReturn5')]
+ public function testModule6(): void
+ {
+ $this->runModuleCommand(
+ filename: 'stack.1.wasm',
+ name: null,
+ line: 156,
+ );
+ }
+}