Matcher,
rawString,
scalarValues,
- splitOnASCIIWhitespace,
+ splitOnAsciiWhitespace,
splitOnCommas,
stringCatenate,
stringEndsWith,
stringSplit,
stringStartsWith,
stringValue,
- stripAndCollapseASCIIWhitespace,
- stripLeadingAndTrailingASCIIWhitespace,
+ stripAndCollapseAsciiWhitespace,
+ stripLeadingAndTrailingAsciiWhitespace,
substring,
toScalarValueString,
toString,
});
});
-describe("splitOnASCIIWhitespace", () => {
+describe("splitOnAsciiWhitespace", () => {
it("[[Call]] splits on sequences of spaces", () => {
assertEquals(
- splitOnASCIIWhitespace("๐
ฐ๏ธ ๐
ฑ๏ธ ๐ ๐
พ๏ธ"),
+ splitOnAsciiWhitespace("๐
ฐ๏ธ ๐
ฑ๏ธ ๐ ๐
พ๏ธ"),
["๐
ฐ๏ธ", "๐
ฑ๏ธ", "๐", "๐
พ๏ธ"],
);
});
it("[[Call]] splits on sequences of tabs", () => {
assertEquals(
- splitOnASCIIWhitespace("๐
ฐ๏ธ\t\t\t๐
ฑ๏ธ\t๐\t\t๐
พ๏ธ"),
+ splitOnAsciiWhitespace("๐
ฐ๏ธ\t\t\t๐
ฑ๏ธ\t๐\t\t๐
พ๏ธ"),
["๐
ฐ๏ธ", "๐
ฑ๏ธ", "๐", "๐
พ๏ธ"],
);
});
it("[[Call]] splits on sequences of carriage returns", () => {
assertEquals(
- splitOnASCIIWhitespace("๐
ฐ๏ธ\r\r\r๐
ฑ๏ธ\r๐\r\r๐
พ๏ธ"),
+ splitOnAsciiWhitespace("๐
ฐ๏ธ\r\r\r๐
ฑ๏ธ\r๐\r\r๐
พ๏ธ"),
["๐
ฐ๏ธ", "๐
ฑ๏ธ", "๐", "๐
พ๏ธ"],
);
});
it("[[Call]] splits on sequences of newlines", () => {
assertEquals(
- splitOnASCIIWhitespace("๐
ฐ๏ธ\r\r\r๐
ฑ๏ธ\r๐\r\r๐
พ๏ธ"),
+ splitOnAsciiWhitespace("๐
ฐ๏ธ\r\r\r๐
ฑ๏ธ\r๐\r\r๐
พ๏ธ"),
["๐
ฐ๏ธ", "๐
ฑ๏ธ", "๐", "๐
พ๏ธ"],
);
});
it("[[Call]] splits on sequences of form feeds", () => {
assertEquals(
- splitOnASCIIWhitespace("๐
ฐ๏ธ\f\f\f๐
ฑ๏ธ\f๐\f\f๐
พ๏ธ"),
+ splitOnAsciiWhitespace("๐
ฐ๏ธ\f\f\f๐
ฑ๏ธ\f๐\f\f๐
พ๏ธ"),
["๐
ฐ๏ธ", "๐
ฑ๏ธ", "๐", "๐
พ๏ธ"],
);
});
it("[[Call]] splits on mixed whitespace", () => {
assertEquals(
- splitOnASCIIWhitespace("๐
ฐ๏ธ\f \t\n๐
ฑ๏ธ\r\n\r๐\n\f๐
พ๏ธ"),
+ splitOnAsciiWhitespace("๐
ฐ๏ธ\f \t\n๐
ฑ๏ธ\r\n\r๐\n\f๐
พ๏ธ"),
["๐
ฐ๏ธ", "๐
ฑ๏ธ", "๐", "๐
พ๏ธ"],
);
});
it("[[Call]] returns an array of just the empty string for the empty string", () => {
- assertEquals(splitOnASCIIWhitespace(""), [""]);
+ assertEquals(splitOnAsciiWhitespace(""), [""]);
});
it("[[Call]] returns a single token if there are no spaces", () => {
- assertEquals(splitOnASCIIWhitespace("abcd"), ["abcd"]);
+ assertEquals(splitOnAsciiWhitespace("abcd"), ["abcd"]);
});
it("[[Call]] does not split on other kinds of whitespace", () => {
assertEquals(
- splitOnASCIIWhitespace("a\u202F\u205F\xa0\v\0\bb"),
+ splitOnAsciiWhitespace("a\u202F\u205F\xa0\v\0\bb"),
["a\u202F\u205F\xa0\v\0\bb"],
);
});
it("[[Call]] trims leading and trailing whitespace", () => {
assertEquals(
- splitOnASCIIWhitespace(
+ splitOnAsciiWhitespace(
"\f\r\n\r\n \n\t๐
ฐ๏ธ\f \t\n๐
ฑ๏ธ\r๐\n\f๐
พ๏ธ\n\f",
),
["๐
ฐ๏ธ", "๐
ฑ๏ธ", "๐", "๐
พ๏ธ"],
});
it("[[Construct]] throws an error", () => {
- assertThrows(() => new splitOnASCIIWhitespace(""));
+ assertThrows(() => new splitOnAsciiWhitespace(""));
});
describe(".length", () => {
it("[[Get]] returns the correct length", () => {
- assertStrictEquals(splitOnASCIIWhitespace.length, 1);
+ assertStrictEquals(splitOnAsciiWhitespace.length, 1);
});
});
describe(".name", () => {
it("[[Get]] returns the correct name", () => {
assertStrictEquals(
- splitOnASCIIWhitespace.name,
- "splitOnASCIIWhitespace",
+ splitOnAsciiWhitespace.name,
+ "splitOnAsciiWhitespace",
);
});
});
});
});
-describe("stripAndCollapseASCIIWhitespace", () => {
+describe("stripAndCollapseAsciiWhitespace", () => {
it("[[Call]] collapses mixed inner whitespace", () => {
assertEquals(
- stripAndCollapseASCIIWhitespace("๐
ฐ๏ธ\f \t\n๐
ฑ๏ธ\r\n\r๐\n\f๐
พ๏ธ"),
+ stripAndCollapseAsciiWhitespace("๐
ฐ๏ธ\f \t\n๐
ฑ๏ธ\r\n\r๐\n\f๐
พ๏ธ"),
"๐
ฐ๏ธ ๐
ฑ๏ธ ๐ ๐
พ๏ธ",
);
});
it("[[Call]] trims leading and trailing whitespace", () => {
assertStrictEquals(
- stripAndCollapseASCIIWhitespace(
+ stripAndCollapseAsciiWhitespace(
"\f\r\n\r\n \n\t\f ๐
ฐ๏ธ\f \t\n๐
ฑ๏ธ\r\n\r๐\n\f๐
พ๏ธ\n\f",
),
"๐
ฐ๏ธ ๐
ฑ๏ธ ๐ ๐
พ๏ธ",
it("[[Call]] returns the empty string for strings of whitespace", () => {
assertStrictEquals(
- stripAndCollapseASCIIWhitespace("\f\r\n\r\n \n\t\f \n\f"),
+ stripAndCollapseAsciiWhitespace("\f\r\n\r\n \n\t\f \n\f"),
"",
);
});
it("[[Call]] does not collapse other kinds of whitespace", () => {
assertEquals(
- stripAndCollapseASCIIWhitespace("a\u202F\u205F\xa0\v\0\bb"),
+ stripAndCollapseAsciiWhitespace("a\u202F\u205F\xa0\v\0\bb"),
"a\u202F\u205F\xa0\v\0\bb",
);
});
it("[[Construct]] throws an error", () => {
- assertThrows(() => new stripAndCollapseASCIIWhitespace(""));
+ assertThrows(() => new stripAndCollapseAsciiWhitespace(""));
});
describe(".length", () => {
it("[[Get]] returns the correct length", () => {
- assertStrictEquals(stripAndCollapseASCIIWhitespace.length, 1);
+ assertStrictEquals(stripAndCollapseAsciiWhitespace.length, 1);
});
});
describe(".name", () => {
it("[[Get]] returns the correct name", () => {
assertStrictEquals(
- stripAndCollapseASCIIWhitespace.name,
- "stripAndCollapseASCIIWhitespace",
+ stripAndCollapseAsciiWhitespace.name,
+ "stripAndCollapseAsciiWhitespace",
);
});
});
});
-describe("stripLeadingAndTrailingASCIIWhitespace", () => {
+describe("stripLeadingAndTrailingAsciiWhitespace", () => {
it("[[Call]] trims leading and trailing whitespace", () => {
assertStrictEquals(
- stripLeadingAndTrailingASCIIWhitespace(
+ stripLeadingAndTrailingAsciiWhitespace(
"\f\r\n\r\n \n\t\f ๐
ฐ๏ธ๐
ฑ๏ธ๐๐
พ๏ธ\n\f",
),
"๐
ฐ๏ธ๐
ฑ๏ธ๐๐
พ๏ธ",
it("[[Call]] returns the empty string for strings of whitespace", () => {
assertStrictEquals(
- stripLeadingAndTrailingASCIIWhitespace("\f\r\n\r\n \n\t\f \n\f"),
+ stripLeadingAndTrailingAsciiWhitespace("\f\r\n\r\n \n\t\f \n\f"),
"",
);
});
it("[[Call]] does not trim other kinds of whitespace", () => {
assertEquals(
- stripLeadingAndTrailingASCIIWhitespace(
+ stripLeadingAndTrailingAsciiWhitespace(
"\v\u202F\u205Fx\0\b\xa0",
),
"\v\u202F\u205Fx\0\b\xa0",
it("[[Call]] does not adjust inner whitespace", () => {
assertEquals(
- stripLeadingAndTrailingASCIIWhitespace("a b"),
+ stripLeadingAndTrailingAsciiWhitespace("a b"),
"a b",
);
});
it("[[Construct]] throws an error", () => {
- assertThrows(() => new stripLeadingAndTrailingASCIIWhitespace(""));
+ assertThrows(() => new stripLeadingAndTrailingAsciiWhitespace(""));
});
describe(".length", () => {
it("[[Get]] returns the correct length", () => {
assertStrictEquals(
- stripLeadingAndTrailingASCIIWhitespace.length,
+ stripLeadingAndTrailingAsciiWhitespace.length,
1,
);
});
describe(".name", () => {
it("[[Get]] returns the correct name", () => {
assertStrictEquals(
- stripLeadingAndTrailingASCIIWhitespace.name,
- "stripLeadingAndTrailingASCIIWhitespace",
+ stripLeadingAndTrailingAsciiWhitespace.name,
+ "stripLeadingAndTrailingAsciiWhitespace",
);
});
});