提交 36391d00 编写于 作者: F fxy060608

新增静态方法内类继承测试例 #16899

上级 d01afeef
import { describe, test, expect, Result } from './tests.uts'
class TestClass {
static test() : boolean {
// 测试静态方法内的class继承
class A { }
class B extends A {
bool : boolean = true
constructor() {
super()
}
}
return new B().bool
}
}
export function testClass() : Result {
return describe("Class", () => {
test('Class static method', () => {
expect(TestClass.test()).toEqual(true)
})
})
}
\ No newline at end of file
......@@ -28,6 +28,7 @@ import { testIterator } from "./iterator.uts"
import { testType } from './Type.uts'
// #endif
import { testUTSXXX } from "./UTSXXX.uts"
import { testClass } from "./Class.uts"
// Proxy、Reflect、Weakmap、WeakSet 不支持
export function runTests(): UTSJSONObject {
......@@ -60,6 +61,7 @@ export function runTests(): UTSJSONObject {
const TypeRes = testType();
// #endif
const testUTSXXXRes = testUTSXXX()
const testClassRes = testClass()
return {
Array: ArrayRes,
Date: DateRes,
......@@ -90,5 +92,6 @@ export function runTests(): UTSJSONObject {
Type: TypeRes,
// #endif
UTSXXX: testUTSXXXRes,
Class: testClassRes
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册