mirror of
https://github.com/arthur-pbty/flint.git
synced 2026-08-01 20:29:03 +02:00
20 lines
733 B
TypeScript
20 lines
733 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { tokenizePrefixInput } from "../src/framework/commands/argParser.js";
|
|
|
|
test("tokenizePrefixInput parse les quotes simples et doubles", () => {
|
|
const tokens = tokenizePrefixInput('"hello world" test \'foo bar\'');
|
|
assert.deepEqual(tokens, ["hello world", "test", "foo bar"]);
|
|
});
|
|
|
|
test("tokenizePrefixInput conserve les tokens non quotes", () => {
|
|
const tokens = tokenizePrefixInput("alpha beta gamma");
|
|
assert.deepEqual(tokens, ["alpha", "beta", "gamma"]);
|
|
});
|
|
|
|
test("tokenizePrefixInput gere les quotes echappees", () => {
|
|
const tokens = tokenizePrefixInput('"say \\"hello\\"" done');
|
|
assert.deepEqual(tokens, ['say "hello"', "done"]);
|
|
});
|