From 4faed9dbf0702ce670a3ced9eeef1283d7ea6706 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 20 Jan 2024 23:38:59 +0800 Subject: [PATCH] some docs update Update 99_builtin_func.py Delete re.md --- docs/modules/re.md | 8 -------- tests/99_builtin_func.py | 41 ---------------------------------------- 2 files changed, 49 deletions(-) delete mode 100644 docs/modules/re.md diff --git a/docs/modules/re.md b/docs/modules/re.md deleted file mode 100644 index ab7ba83a..00000000 --- a/docs/modules/re.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -icon: package -label: re ---- - -!!! -This module was removed in `v1.3.7`. -!!! \ No newline at end of file diff --git a/tests/99_builtin_func.py b/tests/99_builtin_func.py index ebccf232..ba0ea3c8 100644 --- a/tests/99_builtin_func.py +++ b/tests/99_builtin_func.py @@ -548,17 +548,6 @@ assert type(aaa.__signature__) is str # /************ module time ************/ import time -# 未完全测试准确性----------------------------------------------- -# 116: 1267: vm->bind_func<1>(mod, "sleep", [](VM* vm, ArgsView args) { -# #####: 1268: f64 seconds = CAST_F(args[0]); -# #####: 1269: auto begin = std::chrono::system_clock::now(); -# #####: 1270: while(true){ -# #####: 1271: auto now = std::chrono::system_clock::now(); -# #####: 1272: f64 elapsed = std::chrono::duration_cast(now - begin).count() / 1000.0; -# #####: 1273: if(elapsed >= seconds) break; -# #####: 1274: } -# #####: 1275: return vm->None; -# #####: 1276: }); # test time.time assert type(time.time()) is float @@ -573,38 +562,8 @@ assert type(local_t.tm_wday) is int assert type(local_t.tm_yday) is int assert type(local_t.tm_isdst) is int -# 未完全测试准确性----------------------------------------------- -# 116: 1267: vm->bind_func<1>(mod, "sleep", [](VM* vm, ArgsView args) { -# #####: 1268: f64 seconds = CAST_F(args[0]); -# #####: 1269: auto begin = std::chrono::system_clock::now(); -# #####: 1270: while(true){ -# #####: 1271: auto now = std::chrono::system_clock::now(); -# #####: 1272: f64 elapsed = std::chrono::duration_cast(now - begin).count() / 1000.0; -# #####: 1273: if(elapsed >= seconds) break; -# #####: 1274: } -# #####: 1275: return vm->None; -# #####: 1276: }); # test time.sleep time.sleep(0.1) - -# 未完全测试准确性----------------------------------------------- -# 116: 1278: vm->bind_func<0>(mod, "localtime", [](VM* vm, ArgsView args) { -# #####: 1279: auto now = std::chrono::system_clock::now(); -# #####: 1280: std::time_t t = std::chrono::system_clock::to_time_t(now); -# #####: 1281: std::tm* tm = std::localtime(&t); -# #####: 1282: Dict d(vm); -# #####: 1283: d.set(VAR("tm_year"), VAR(tm->tm_year + 1900)); -# #####: 1284: d.set(VAR("tm_mon"), VAR(tm->tm_mon + 1)); -# #####: 1285: d.set(VAR("tm_mday"), VAR(tm->tm_mday)); -# #####: 1286: d.set(VAR("tm_hour"), VAR(tm->tm_hour)); -# #####: 1287: d.set(VAR("tm_min"), VAR(tm->tm_min)); -# #####: 1288: d.set(VAR("tm_sec"), VAR(tm->tm_sec + 1)); -# #####: 1289: d.set(VAR("tm_wday"), VAR((tm->tm_wday + 6) % 7)); -# #####: 1290: d.set(VAR("tm_yday"), VAR(tm->tm_yday + 1)); -# #####: 1291: d.set(VAR("tm_isdst"), VAR(tm->tm_isdst)); -# #####: 1292: return VAR(std::move(d)); -# #####: 1293: }); -# 58: 1294:} # test time.localtime assert type(time.localtime()) is time.struct_time