chore: add TokenLens sources and ignore rules
This commit is contained in:
12
tests/displayFormat.test.mjs
Normal file
12
tests/displayFormat.test.mjs
Normal 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亿");
|
||||
});
|
||||
Reference in New Issue
Block a user