0 && count($data) <= 5, 'limit 生效'); assert_eq(['word', 'count', 'bold'], array_keys($data[0]), '字段'); foreach ($data as $w) { assert_eq(true, str_starts_with($w['word'], 'vitakk'), "{$w['word']} 以前缀开头"); } $counts = array_column($data, 'count'); $sorted = $counts; rsort($sorted); assert_eq($sorted, $counts, '按出现次数降序'); }); test('GET /v3/pali-word-suggestions 缺 q / limit 越界 → 422', function () { assert_status(422, raw('GET', '/v3/pali-word-suggestions'), '缺 q'); assert_status(422, raw('GET', '/v3/pali-word-suggestions?q=a&limit=51'), 'limit 越界'); });