Files
aitbc/dev/env/node_modules/@streamparser/json-node/test/offset.ts
aitbc 816e258d4c refactor: move brother_node development artifact to dev/test-nodes subdirectory
Development Artifact Cleanup:
 BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location
- dev/test-nodes/brother_node/: Moved from root directory for better organization
- Contains development configuration, test logs, and test chain data
- No impact on production systems - purely development/testing artifact

 DEVELOPMENT ARTIFACTS IDENTIFIED:
- Chain ID: aitbc-brother-chain (test/development chain)
- Ports: 8010 (P2P) and 8011 (RPC) - different from production
- Environment: .env file with test configuration
- Logs: rpc.log and node.log from development testing session (March 15, 2026)

 ROOT DIRECTORY CLEANUP: Removed development clutter from production directory
- brother_node/ moved to dev/test-nodes/brother_node/
- Root directory now contains only production-ready components
- Development artifacts properly organized in dev/ subdirectory

DIRECTORY STRUCTURE IMPROVEMENT:
📁 dev/test-nodes/: Development and testing node configurations
🏗️ Root Directory: Clean production structure with only essential components
🧪 Development Isolation: Test environments separated from production

BENEFITS:
 Clean Production Directory: No development artifacts in root
 Better Organization: Development nodes grouped in dev/ subdirectory
 Clear Separation: Production vs development environments clearly distinguished
 Maintainability: Easier to identify and manage development components

RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
2026-03-30 17:09:06 +02:00

70 lines
1.9 KiB
TypeScript
Executable File

import { runTokenizerTest } from "./utils/testRunner.js";
import { Tokenizer } from "../src/index.js";
import TokenType from "@streamparser/json/utils/types/tokenType.js";
const input1 = '{\n "string": "value",\n "number": 3,\n "object"';
const input2 = ': {\n "key": "vд"\n },\n "array": [\n -1,\n 12\n ]\n ';
const input3 = '"null": null, "true": true, "false": false, "frac": 3.14,';
const input4 = '"escape": "\\"\\u00e1" }';
const offsets = [
[0, TokenType.LEFT_BRACE],
[4, TokenType.STRING],
[12, TokenType.COLON],
[14, TokenType.STRING],
[21, TokenType.COMMA],
[25, TokenType.STRING],
[33, TokenType.COLON],
[35, TokenType.NUMBER],
[36, TokenType.COMMA],
[40, TokenType.STRING],
[48, TokenType.COLON],
[50, TokenType.LEFT_BRACE],
[54, TokenType.STRING],
[59, TokenType.COLON],
[61, TokenType.STRING],
[69, TokenType.RIGHT_BRACE],
[70, TokenType.COMMA],
[74, TokenType.STRING],
[81, TokenType.COLON],
[83, TokenType.LEFT_BRACKET],
[87, TokenType.NUMBER],
[89, TokenType.COMMA],
[93, TokenType.NUMBER],
[98, TokenType.RIGHT_BRACKET],
[102, TokenType.STRING],
[108, TokenType.COLON],
[110, TokenType.NULL],
[114, TokenType.COMMA],
[116, TokenType.STRING],
[122, TokenType.COLON],
[124, TokenType.TRUE],
[128, TokenType.COMMA],
[130, TokenType.STRING],
[137, TokenType.COLON],
[139, TokenType.FALSE],
[144, TokenType.COMMA],
[146, TokenType.STRING],
[152, TokenType.COLON],
[154, TokenType.NUMBER],
[158, TokenType.COMMA],
[159, TokenType.STRING],
[167, TokenType.COLON],
[169, TokenType.STRING],
[180, TokenType.RIGHT_BRACE],
];
test("offset", async () => {
let i = 0;
await runTokenizerTest(
new Tokenizer(),
[input1, input2, input3, input4],
({ token, offset }) => {
expect(offset).toEqual(offsets[i][0]);
expect(token).toEqual(offsets[i][1]);
i += 1;
},
);
});