fix: restore legacy cron schedules and shell diagnostics (#3078)

This commit is contained in:
whyour
2026-09-27 16:16:22 +08:00
parent a67d44cde5
commit a8310e7d51
9 changed files with 108 additions and 18 deletions
@@ -0,0 +1,16 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const { spawnSync } = require('node:child_process');
test('shell translations print leading dashes, placeholders and newlines', () => {
const result = spawnSync('bash', ['-c', String.raw`
source shell/share.sh
t '---> 服务诊断信息'
t '---> 最近的系统日志: %s' '/tmp/test.log'
t 'first\nsecond'
`], { encoding: 'utf8', env: { ...process.env, QL_DIR: process.cwd() } });
assert.equal(result.status, 0, result.stderr);
assert.equal(result.stderr, '');
assert.equal(result.stdout,
'---> 服务诊断信息\n---> 最近的系统日志: /tmp/test.log\nfirst\nsecond\n');
});