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

增加 date/number.tostring 部分测试示例

上级 10ac639b
......@@ -6,11 +6,12 @@
>
<!--meta-data-->
<meta-data android:name="TencentMapSDK" android:value="您申请的腾讯定位App Key" />
<!--需要替换成开发者自己的包名-->
<activity android:name="uni.UNI70BE9D0.RootPackageActivity"
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<!--需要替换成开发者自己的包名-->
<action android:name="uni.UNI70BE9D0.RootPackageActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
......
......@@ -194,6 +194,7 @@ class RootActivityStartListener extends OnClickListener{
}
override onClick(v?: View):void{
// 需要开发者替换成自己的包名,并且与AndroidManifest.xml 中保持一致
let intent = Intent("uni.UNI70BE9D0.RootPackageActivity")
host.startActivity(intent)
}
......
......@@ -10,6 +10,15 @@ export function testDate() : Result {
expect(secondsElapsed).toEqual(2);
}, 2000)
})
test('new Date', () => {
let date1 = new Date('1992-02-02');
console.log("1111",date1.getTime())
expect(date1.getTime()).toEqual(696988800000);
let date2 = new Date('1992-2-02');
console.log("2222",date2.getTime())
expect(date2.getTime()).toEqual(696960000000);
})
test('valueOf', () => {
const date1 = new Date('December 17, 1995 03:24:00');
expect(date1.valueOf()).toEqual(819141840000);
......@@ -105,6 +114,7 @@ export function testDate() : Result {
// subsequent millisecond
expect(new Date(2016, 6, 6, 13, 59, 59, 1000).getHours()).toEqual(14);
})
test('getMilliseconds', () => {
const moonLanding = new Date('July 20, 69 00:20:18');
moonLanding.setMilliseconds(123);
......
......@@ -84,6 +84,7 @@ export function testNumber() : Result {
expect((6).toString(2)).toEqual("110");
expect((254).toString(16)).toEqual("fe");
expect((-10).toString(2)).toEqual("-1010");
expect((-0xff).toString(2)).toEqual("-11111111");
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册