From 88a77bc5846541e5d6009bc103da378650a649f3 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 28 Apr 2024 11:02:51 +0900 Subject: test: generate PHPUnit classes from WAST files --- tests/src/SpecTestsuites/Core/StackTest.php | 85 +++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 tests/src/SpecTestsuites/Core/StackTest.php (limited to 'tests/src/SpecTestsuites/Core/StackTest.php') 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 @@ +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, + ); + } +} -- cgit v1.2.3-70-g09d2