mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 16:44:23 +08:00
🎉 Sync 2026-09-27 21:03:26
This commit is contained in:
1 parent
f4559bbed1
commit
065763f7fd
673 files changed
+261285
-34160
No files matched your search
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
let runtime = require('runtime');
|
||||
let refresh = require('refresh');
|
||||
|
||||
let accepted = refresh.call();
|
||||
assert(accepted.ok == true && accepted.accepted == true, 'accepted refresh succeeds');
|
||||
assert(accepted.status.marker == 'test-status', 'refresh returns current status');
|
||||
|
||||
runtime.state.accepted = false;
|
||||
runtime.state.reason = 'already_running';
|
||||
let running = refresh.call();
|
||||
assert(running.ok == true && running.accepted == false, 'already-running refresh is idempotent');
|
||||
assert(running.reason == 'already_running', 'already-running reason is preserved');
|
||||
|
||||
runtime.state.reason = 'disabled';
|
||||
let disabled = refresh.call();
|
||||
assert(disabled.ok == false && disabled.accepted == false, 'disabled refresh is rejected');
|
||||
assert(disabled.reason == 'disabled', 'disabled reason is preserved');
|
||||
|
||||
print('ucode refresh tests: ok\n');
|
||||
Reference in new issue
Block a user