diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-06-02 04:23:31 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-06-02 04:23:31 +0900 |
| commit | 3e402a951e455d22aa8a23293327bb4b791bf390 (patch) | |
| tree | 15903a56bc3728563d94fb060a8be0f412671353 | |
| parent | 7c0ebc680e19398fdfd56d3a64f0c643ec07fbe0 (diff) | |
| download | php-waddiwasi-3e402a951e455d22aa8a23293327bb4b791bf390.tar.gz php-waddiwasi-3e402a951e455d22aa8a23293327bb4b791bf390.tar.zst php-waddiwasi-3e402a951e455d22aa8a23293327bb4b791bf390.zip | |
test: RefNull passed
| -rw-r--r-- | tests/src/SpecTestsuites/SpecTestsuiteBase.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/src/SpecTestsuites/SpecTestsuiteBase.php b/tests/src/SpecTestsuites/SpecTestsuiteBase.php index 5b3f64f..36eedec 100644 --- a/tests/src/SpecTestsuites/SpecTestsuiteBase.php +++ b/tests/src/SpecTestsuites/SpecTestsuiteBase.php @@ -8,6 +8,8 @@ use Nsfisis\Waddiwasi\BinaryFormat\Decoder; use Nsfisis\Waddiwasi\BinaryFormat\InvalidBinaryFormatException; use Nsfisis\Waddiwasi\Execution\Ref; use Nsfisis\Waddiwasi\Execution\Refs\RefExtern; +use Nsfisis\Waddiwasi\Execution\Refs\RefFunc; +use Nsfisis\Waddiwasi\Execution\Refs\RefNull; use Nsfisis\Waddiwasi\Execution\Runtime; use Nsfisis\Waddiwasi\Execution\StackOverflowException; use Nsfisis\Waddiwasi\Execution\Store; @@ -213,6 +215,12 @@ abstract class SpecTestsuiteBase extends TestCase is_nan($actualResult), "result $i is not NaN" . $message, ); + } elseif ($expectedValue instanceof RefNull) { + $this->assertInstanceOf( + RefNull::class, + $actualResult, + "result $i is not a null" . $message, + ); } elseif ($expectedValue instanceof RefExtern) { $this->assertInstanceOf( RefExtern::class, @@ -224,6 +232,17 @@ abstract class SpecTestsuiteBase extends TestCase $actualResult->addr, "result $i mismatch" . $message, ); + } elseif ($expectedValue instanceof RefFunc) { + $this->assertInstanceOf( + RefFunc::class, + $actualResult, + "result $i is not an funcref" . $message, + ); + $this->assertSame( + $expectedValue->addr, + $actualResult->addr, + "result $i mismatch" . $message, + ); } else { $this->assertSame( $expectedValue, |
