diff options
Diffstat (limited to 'tests/src/SpecTestsuites/Core/RefNullTest.php')
| -rw-r--r-- | tests/src/SpecTestsuites/Core/RefNullTest.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/src/SpecTestsuites/Core/RefNullTest.php b/tests/src/SpecTestsuites/Core/RefNullTest.php new file mode 100644 index 0000000..019a609 --- /dev/null +++ b/tests/src/SpecTestsuites/Core/RefNullTest.php @@ -0,0 +1,42 @@ +<?php + +declare(strict_types=1); + +namespace Nsfisis\Waddiwasi\Tests\SpecTestsuites\Core; + +use Nsfisis\Waddiwasi\Tests\SpecTestsuites\SpecTestsuiteBase; +use PHPUnit\Framework\Attributes\Depends; + +final class RefNullTest extends SpecTestsuiteBase +{ + public function testModule0(): void + { + $this->runModuleCommand( + filename: 'ref_null.0.wasm', + name: null, + line: 1, + ); + } + + #[Depends('testModule0')] + public function testAssertReturn1(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'externref', 'args' => []], + expected: [['type' => 'externref', 'value' => 'null']], + line: 9, + ); + } + + #[Depends('testAssertReturn1')] + public function testAssertReturn2(): void + { + $this->runAssertReturnCommand( + module: null, + action: ['type' => 'invoke', 'field' => 'funcref', 'args' => []], + expected: [['type' => 'funcref', 'value' => 'null']], + line: 10, + ); + } +} |
