提交 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);
...@@ -236,10 +240,12 @@ export function testMath(): Result { ...@@ -236,10 +240,12 @@ export function testMath(): Result {
expect(Math.trunc(42.84)).toEqual(42); expect(Math.trunc(42.84)).toEqual(42);
expect(Math.trunc(0.123)).toEqual(0); expect(Math.trunc(0.123)).toEqual(0);
}) })
test('round', () => { test('round', () => {
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);
})
}) })
} }
...@@ -3,7 +3,8 @@ import { testDate } from './Date.uts' ...@@ -3,7 +3,8 @@ import { testDate } from './Date.uts'
import { testString } from './String.uts' 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'
...@@ -31,14 +32,16 @@ export function runTests() : UTSJSONObject { ...@@ -31,14 +32,16 @@ export function runTests() : UTSJSONObject {
const KeyWordRes = testKeyWord(); const KeyWordRes = testKeyWord();
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,
Date: DateRes, Date: DateRes,
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.
先完成此消息的编辑!
想要评论请 注册