chore: add TokenLens sources and ignore rules

This commit is contained in:
2026-06-12 15:45:58 +08:00
parent 0b48e618d8
commit 887b75b790
37 changed files with 13907 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import test from "node:test";
import assert from "node:assert/strict";
import { formatTokensZh } from "../src/renderer/displayFormat.js";
test("formatTokensZh uses Chinese magnitude units instead of western suffixes", () => {
assert.equal(formatTokensZh(9999), "9999");
assert.equal(formatTokensZh(10_000), "1万");
assert.equal(formatTokensZh(71_400), "7.1万");
assert.equal(formatTokensZh(6_600_000), "660万");
assert.equal(formatTokensZh(196_700_000), "1.97亿");
assert.equal(formatTokensZh(1_020_000_000), "10.2亿");
});