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

补充大json解析 和Math.ceil 测试示例

上级 0ef0688a
此差异已折叠。
...@@ -109,6 +109,8 @@ export function testMath(): Result { ...@@ -109,6 +109,8 @@ export function testMath(): Result {
expect(Math.ceil(4)).toEqual(4); expect(Math.ceil(4)).toEqual(4);
expect(Math.ceil(7.004)).toEqual(8); expect(Math.ceil(7.004)).toEqual(8);
expect(Math.ceil(-7.004)).toEqual(-7); expect(Math.ceil(-7.004)).toEqual(-7);
expect(Math.ceil(37110233000.223)).toEqual(37110233001);
expect(Math.ceil(-37110233000.223)).toEqual(-37110233000);
}) })
test('clz32', () => { test('clz32', () => {
expect(Math.clz32(1)).toEqual(31); expect(Math.clz32(1)).toEqual(31);
...@@ -141,6 +143,8 @@ export function testMath(): Result { ...@@ -141,6 +143,8 @@ export function testMath(): Result {
expect(Math.floor(5.05)).toEqual(5); expect(Math.floor(5.05)).toEqual(5);
expect(Math.floor(5)).toEqual(5); expect(Math.floor(5)).toEqual(5);
expect(Math.floor(-5.05)).toEqual(-6); expect(Math.floor(-5.05)).toEqual(-6);
expect(Math.floor(37110233000.223)).toEqual(37110233000);
expect(Math.floor(-37110233000.223)).toEqual(-37110233001);
}) })
test('fround', () => { test('fround', () => {
expect(Math.fround(1.5)).toEqual(1.5); expect(Math.fround(1.5)).toEqual(1.5);
...@@ -240,6 +244,8 @@ export function testMath(): Result { ...@@ -240,6 +244,8 @@ export function testMath(): Result {
expect(Math.round(0.9)).toEqual(1); expect(Math.round(0.9)).toEqual(1);
expect(Math.round(5.95)).toEqual(6); expect(Math.round(5.95)).toEqual(6);
expect(Math.round(-5.05)).toEqual(-5); expect(Math.round(-5.05)).toEqual(-5);
expect(Math.round(37110233000.223)).toEqual(37110233000);
expect(Math.round(-37110233000.223)).toEqual(-37110233000);
}) })
}) })
} }
...@@ -4,6 +4,7 @@ import { testString } from './String.uts' ...@@ -4,6 +4,7 @@ import { testString } from './String.uts'
import { testError } from './Error.uts' import { testError } from './Error.uts'
import { testKeyWord } from './KeyWord.uts' import { testKeyWord } from './KeyWord.uts'
import { testJSON } from './JSON.uts' import { testJSON } from './JSON.uts'
import { testJSONLarge } from './JSON_large.uts'
import { testNumber } from './Number.uts' import { testNumber } from './Number.uts'
import { testMap } from './Map.uts' import { testMap } from './Map.uts'
import { testSet } from './Set.uts' import { testSet } from './Set.uts'
...@@ -32,6 +33,7 @@ export function runTests() : UTSJSONObject { ...@@ -32,6 +33,7 @@ export function runTests() : UTSJSONObject {
const ForLoopRes = testForLoop(); const ForLoopRes = testForLoop();
const GlobalRes = testGlobal(); const GlobalRes = testGlobal();
const TypeRes = testType(); const TypeRes = testType();
const JSONLargeRes = testJSONLarge();
return { return {
Array: ArrayRes, Array: ArrayRes,
...@@ -39,6 +41,7 @@ export function runTests() : UTSJSONObject { ...@@ -39,6 +41,7 @@ export function runTests() : UTSJSONObject {
String: StringRes, String: StringRes,
Error: ErrorRes, Error: ErrorRes,
Json: JsonRes, Json: JsonRes,
JSONLarge:JSONLargeRes,
Number: NumberRes, Number: NumberRes,
Map: MapRes, Map: MapRes,
Set: SetRes, Set: SetRes,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册