提交 5e8f2cb3 编写于 作者: lizhongyi_'s avatar lizhongyi_

iOS新增instanceTest测试例

上级 bd9a846a
...@@ -214,3 +214,20 @@ export function logFunctionTest(){ ...@@ -214,3 +214,20 @@ export function logFunctionTest(){
} }
console.log(testFun) console.log(testFun)
} }
export class User {
private name : string;
private age : Int;
constructor(hostP : string, port : Int) {
this.name = hostP;
this.age = port;
}
describeSelf():string{
let text = "name = " + this.name + ";age = " + `${this.age}`
return text
}
}
\ No newline at end of file
...@@ -88,6 +88,12 @@ export function testNumber() : Result { ...@@ -88,6 +88,12 @@ export function testNumber() : Result {
expect((-10.22).toString(8)).toEqual("-12.16050753412172704"); expect((-10.22).toString(8)).toEqual("-12.16050753412172704");
expect((123456789987654).toString(16)).toEqual("7048861cc146"); expect((123456789987654).toString(16)).toEqual("7048861cc146");
expect((-0xff).toString(2)).toEqual("-11111111"); expect((-0xff).toString(2)).toEqual("-11111111");
const a = 1e38
expect(a.toString(16)).toEqual("4b3b4ca85a86c4000000000000000000");
expect(a.toString(2)).toEqual("1001011001110110100110010101000010110101000011011000100000000000000000000000000000000000000000000000000000000000000000000000000")
const b = 1e22
expect(b.toString(12)).toEqual("27373a86ba1a194a65054");
}) })
test('valueOf', () => { test('valueOf', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册