提交 d1a7d908 编写于 作者: 杜庆泉's avatar 杜庆泉

增加 parseInt/parseFloat 测试示例

上级 68a8bbbd
...@@ -76,7 +76,8 @@ export function testGlobal() : Result { ...@@ -76,7 +76,8 @@ export function testGlobal() : Result {
expect(parseInt("922337203685477580700099999999999999999999999999999999999999999999999999999999999999999")).toEqualNumber(9.223372036854776e+86) expect(parseInt("922337203685477580700099999999999999999999999999999999999999999999999999999999999999999")).toEqualNumber(9.223372036854776e+86)
expect(parseInt("50") / 100).toEqualNumber(0.5); expect(parseInt("50") / 100).toEqualNumber(0.5);
expect(parseInt("500") / 100).toEqualNumber(5); expect(parseInt("500") / 100).toEqualNumber(5);
expect(parseFloat("3.0").toString()).toEqual("3");
expect(parseFloat("3.02").toString()).toEqual("3");
// #END // #END
}) })
...@@ -90,6 +91,9 @@ export function testGlobal() : Result { ...@@ -90,6 +91,9 @@ export function testGlobal() : Result {
expect(parseFloat("3.14some non-digit characters")).toEqual(3.14); expect(parseFloat("3.14some non-digit characters")).toEqual(3.14);
expect(parseFloat("100") / 50).toEqualNumber(2); expect(parseFloat("100") / 50).toEqualNumber(2);
expect(parseFloat("105") / 50).toEqual(2.1); expect(parseFloat("105") / 50).toEqual(2.1);
expect(parseFloat("3.0").toString()).toEqual("3");
expect(parseFloat("3.02").toString()).toEqual("3.02");
// #END // #END
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册