TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
645 B

<?php
final class WasmExportAttributeTest extends BaseTest
{
public function testAcceptsNamedFunctionWithConstantExportName(): void
{
$this->compile('wasm-export-valid.php');
}
public function testRejectsMethods(): void
{
$this->expectException(\TypePhp\Exception\SyntaxError::class);
$this->expectExceptionMessage('WasmExport can only be applied to named functions');
$this->compile('wasm-export-invalid-method.php');
}
public function testRejectsNonStringName(): void
{
$this->exec('WasmExport name must be a constant string', 'wasm-export-invalid-name.php');
}
}