authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-08-12 14:23:57+02:00
committergravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-08-16 00:20:19+02:00
logf07cba10a3b8bfe5fa75da9f67284c9b2869b261
tree545173d9c72276822d1566d41067292e74d1c191
parentd2342370fe85491cb8216ccce9cc8fb5259376e2

test(names): remove unnecessary "tokenizer - " prefix


1 files changed, 30 insertions(+), 30 deletions(-)

lib/std/zig/tokenizer.zig+30-30
...@@ -1485,7 +1485,7 @@ test "line comment followed by top-level comptime" {...@@ -1485,7 +1485,7 @@ test "line comment followed by top-level comptime" {
1485 });1485 });
1486}1486}
14871487
1488test "tokenizer - unknown length pointer and then c pointer" {1488test "unknown length pointer and then c pointer" {
1489 try testTokenize(1489 try testTokenize(
1490 \\[*]u81490 \\[*]u8
1491 \\[*c]u81491 \\[*c]u8
...@@ -1502,7 +1502,7 @@ test "tokenizer - unknown length pointer and then c pointer" {...@@ -1502,7 +1502,7 @@ test "tokenizer - unknown length pointer and then c pointer" {
1502 });1502 });
1503}1503}
15041504
1505test "tokenizer - code point literal with hex escape" {1505test "code point literal with hex escape" {
1506 try testTokenize(1506 try testTokenize(
1507 \\'\x1b'1507 \\'\x1b'
1508 , &.{.char_literal});1508 , &.{.char_literal});
...@@ -1511,21 +1511,21 @@ test "tokenizer - code point literal with hex escape" {...@@ -1511,21 +1511,21 @@ test "tokenizer - code point literal with hex escape" {
1511 , &.{ .invalid, .invalid });1511 , &.{ .invalid, .invalid });
1512}1512}
15131513
1514test "tokenizer - newline in char literal" {1514test "newline in char literal" {
1515 try testTokenize(1515 try testTokenize(
1516 \\'1516 \\'
1517 \\'1517 \\'
1518 , &.{ .invalid, .invalid });1518 , &.{ .invalid, .invalid });
1519}1519}
15201520
1521test "tokenizer - newline in string literal" {1521test "newline in string literal" {
1522 try testTokenize(1522 try testTokenize(
1523 \\"1523 \\"
1524 \\"1524 \\"
1525 , &.{ .invalid, .string_literal });1525 , &.{ .invalid, .string_literal });
1526}1526}
15271527
1528test "tokenizer - code point literal with unicode escapes" {1528test "code point literal with unicode escapes" {
1529 // Valid unicode escapes1529 // Valid unicode escapes
1530 try testTokenize(1530 try testTokenize(
1531 \\'\u{3}'1531 \\'\u{3}'
...@@ -1575,13 +1575,13 @@ test "tokenizer - code point literal with unicode escapes" {...@@ -1575,13 +1575,13 @@ test "tokenizer - code point literal with unicode escapes" {
1575 , &.{ .invalid, .integer_literal, .invalid });1575 , &.{ .invalid, .integer_literal, .invalid });
1576}1576}
15771577
1578test "tokenizer - code point literal with unicode code point" {1578test "code point literal with unicode code point" {
1579 try testTokenize(1579 try testTokenize(
1580 \\'💩'1580 \\'💩'
1581 , &.{.char_literal});1581 , &.{.char_literal});
1582}1582}
15831583
1584test "tokenizer - float literal e exponent" {1584test "float literal e exponent" {
1585 try testTokenize("a = 4.94065645841246544177e-324;\n", &.{1585 try testTokenize("a = 4.94065645841246544177e-324;\n", &.{
1586 .identifier,1586 .identifier,
1587 .equal,1587 .equal,
...@@ -1590,7 +1590,7 @@ test "tokenizer - float literal e exponent" {...@@ -1590,7 +1590,7 @@ test "tokenizer - float literal e exponent" {
1590 });1590 });
1591}1591}
15921592
1593test "tokenizer - float literal p exponent" {1593test "float literal p exponent" {
1594 try testTokenize("a = 0x1.a827999fcef32p+1022;\n", &.{1594 try testTokenize("a = 0x1.a827999fcef32p+1022;\n", &.{
1595 .identifier,1595 .identifier,
1596 .equal,1596 .equal,
...@@ -1599,11 +1599,11 @@ test "tokenizer - float literal p exponent" {...@@ -1599,11 +1599,11 @@ test "tokenizer - float literal p exponent" {
1599 });1599 });
1600}1600}
16011601
1602test "tokenizer - chars" {1602test "chars" {
1603 try testTokenize("'c'", &.{.char_literal});1603 try testTokenize("'c'", &.{.char_literal});
1604}1604}
16051605
1606test "tokenizer - invalid token characters" {1606test "invalid token characters" {
1607 try testTokenize("#", &.{.invalid});1607 try testTokenize("#", &.{.invalid});
1608 try testTokenize("`", &.{.invalid});1608 try testTokenize("`", &.{.invalid});
1609 try testTokenize("'c", &.{.invalid});1609 try testTokenize("'c", &.{.invalid});
...@@ -1611,7 +1611,7 @@ test "tokenizer - invalid token characters" {...@@ -1611,7 +1611,7 @@ test "tokenizer - invalid token characters" {
1611 try testTokenize("''", &.{ .invalid, .invalid });1611 try testTokenize("''", &.{ .invalid, .invalid });
1612}1612}
16131613
1614test "tokenizer - invalid literal/comment characters" {1614test "invalid literal/comment characters" {
1615 try testTokenize("\"\x00\"", &.{1615 try testTokenize("\"\x00\"", &.{
1616 .string_literal,1616 .string_literal,
1617 .invalid,1617 .invalid,
...@@ -1627,12 +1627,12 @@ test "tokenizer - invalid literal/comment characters" {...@@ -1627,12 +1627,12 @@ test "tokenizer - invalid literal/comment characters" {
1627 });1627 });
1628}1628}
16291629
1630test "tokenizer - utf8" {1630test "utf8" {
1631 try testTokenize("//\xc2\x80", &.{});1631 try testTokenize("//\xc2\x80", &.{});
1632 try testTokenize("//\xf4\x8f\xbf\xbf", &.{});1632 try testTokenize("//\xf4\x8f\xbf\xbf", &.{});
1633}1633}
16341634
1635test "tokenizer - invalid utf8" {1635test "invalid utf8" {
1636 try testTokenize("//\x80", &.{1636 try testTokenize("//\x80", &.{
1637 .invalid,1637 .invalid,
1638 });1638 });
...@@ -1659,7 +1659,7 @@ test "tokenizer - invalid utf8" {...@@ -1659,7 +1659,7 @@ test "tokenizer - invalid utf8" {
1659 });1659 });
1660}1660}
16611661
1662test "tokenizer - illegal unicode codepoints" {1662test "illegal unicode codepoints" {
1663 // unicode newline characters.U+0085, U+2028, U+20291663 // unicode newline characters.U+0085, U+2028, U+2029
1664 try testTokenize("//\xc2\x84", &.{});1664 try testTokenize("//\xc2\x84", &.{});
1665 try testTokenize("//\xc2\x85", &.{1665 try testTokenize("//\xc2\x85", &.{
...@@ -1676,7 +1676,7 @@ test "tokenizer - illegal unicode codepoints" {...@@ -1676,7 +1676,7 @@ test "tokenizer - illegal unicode codepoints" {
1676 try testTokenize("//\xe2\x80\xaa", &.{});1676 try testTokenize("//\xe2\x80\xaa", &.{});
1677}1677}
16781678
1679test "tokenizer - string identifier and builtin fns" {1679test "string identifier and builtin fns" {
1680 try testTokenize(1680 try testTokenize(
1681 \\const @"if" = @import("std");1681 \\const @"if" = @import("std");
1682 , &.{1682 , &.{
...@@ -1691,7 +1691,7 @@ test "tokenizer - string identifier and builtin fns" {...@@ -1691,7 +1691,7 @@ test "tokenizer - string identifier and builtin fns" {
1691 });1691 });
1692}1692}
16931693
1694test "tokenizer - multiline string literal with literal tab" {1694test "multiline string literal with literal tab" {
1695 try testTokenize(1695 try testTokenize(
1696 \\\\foo bar1696 \\\\foo bar
1697 , &.{1697 , &.{
...@@ -1699,7 +1699,7 @@ test "tokenizer - multiline string literal with literal tab" {...@@ -1699,7 +1699,7 @@ test "tokenizer - multiline string literal with literal tab" {
1699 });1699 });
1700}1700}
17011701
1702test "tokenizer - comments with literal tab" {1702test "comments with literal tab" {
1703 try testTokenize(1703 try testTokenize(
1704 \\//foo bar1704 \\//foo bar
1705 \\//!foo bar1705 \\//!foo bar
...@@ -1715,14 +1715,14 @@ test "tokenizer - comments with literal tab" {...@@ -1715,14 +1715,14 @@ test "tokenizer - comments with literal tab" {
1715 });1715 });
1716}1716}
17171717
1718test "tokenizer - pipe and then invalid" {1718test "pipe and then invalid" {
1719 try testTokenize("||=", &.{1719 try testTokenize("||=", &.{
1720 .pipe_pipe,1720 .pipe_pipe,
1721 .equal,1721 .equal,
1722 });1722 });
1723}1723}
17241724
1725test "tokenizer - line comment and doc comment" {1725test "line comment and doc comment" {
1726 try testTokenize("//", &.{});1726 try testTokenize("//", &.{});
1727 try testTokenize("// a / b", &.{});1727 try testTokenize("// a / b", &.{});
1728 try testTokenize("// /", &.{});1728 try testTokenize("// /", &.{});
...@@ -1733,7 +1733,7 @@ test "tokenizer - line comment and doc comment" {...@@ -1733,7 +1733,7 @@ test "tokenizer - line comment and doc comment" {
1733 try testTokenize("//!!", &.{.container_doc_comment});1733 try testTokenize("//!!", &.{.container_doc_comment});
1734}1734}
17351735
1736test "tokenizer - line comment followed by identifier" {1736test "line comment followed by identifier" {
1737 try testTokenize(1737 try testTokenize(
1738 \\ Unexpected,1738 \\ Unexpected,
1739 \\ // another1739 \\ // another
...@@ -1746,7 +1746,7 @@ test "tokenizer - line comment followed by identifier" {...@@ -1746,7 +1746,7 @@ test "tokenizer - line comment followed by identifier" {
1746 });1746 });
1747}1747}
17481748
1749test "tokenizer - UTF-8 BOM is recognized and skipped" {1749test "UTF-8 BOM is recognized and skipped" {
1750 try testTokenize("\xEF\xBB\xBFa;\n", &.{1750 try testTokenize("\xEF\xBB\xBFa;\n", &.{
1751 .identifier,1751 .identifier,
1752 .semicolon,1752 .semicolon,
...@@ -1788,7 +1788,7 @@ test "correctly parse pointer dereference followed by asterisk" {...@@ -1788,7 +1788,7 @@ test "correctly parse pointer dereference followed by asterisk" {
1788 });1788 });
1789}1789}
17901790
1791test "tokenizer - range literals" {1791test "range literals" {
1792 try testTokenize("0...9", &.{ .integer_literal, .ellipsis3, .integer_literal });1792 try testTokenize("0...9", &.{ .integer_literal, .ellipsis3, .integer_literal });
1793 try testTokenize("'0'...'9'", &.{ .char_literal, .ellipsis3, .char_literal });1793 try testTokenize("'0'...'9'", &.{ .char_literal, .ellipsis3, .char_literal });
1794 try testTokenize("0x00...0x09", &.{ .integer_literal, .ellipsis3, .integer_literal });1794 try testTokenize("0x00...0x09", &.{ .integer_literal, .ellipsis3, .integer_literal });
...@@ -1796,7 +1796,7 @@ test "tokenizer - range literals" {...@@ -1796,7 +1796,7 @@ test "tokenizer - range literals" {
1796 try testTokenize("0o00...0o11", &.{ .integer_literal, .ellipsis3, .integer_literal });1796 try testTokenize("0o00...0o11", &.{ .integer_literal, .ellipsis3, .integer_literal });
1797}1797}
17981798
1799test "tokenizer - number literals decimal" {1799test "number literals decimal" {
1800 try testTokenize("0", &.{.integer_literal});1800 try testTokenize("0", &.{.integer_literal});
1801 try testTokenize("1", &.{.integer_literal});1801 try testTokenize("1", &.{.integer_literal});
1802 try testTokenize("2", &.{.integer_literal});1802 try testTokenize("2", &.{.integer_literal});
...@@ -1863,7 +1863,7 @@ test "tokenizer - number literals decimal" {...@@ -1863,7 +1863,7 @@ test "tokenizer - number literals decimal" {
1863 try testTokenize("1.0e0_+", &.{ .invalid, .plus });1863 try testTokenize("1.0e0_+", &.{ .invalid, .plus });
1864}1864}
18651865
1866test "tokenizer - number literals binary" {1866test "number literals binary" {
1867 try testTokenize("0b0", &.{.integer_literal});1867 try testTokenize("0b0", &.{.integer_literal});
1868 try testTokenize("0b1", &.{.integer_literal});1868 try testTokenize("0b1", &.{.integer_literal});
1869 try testTokenize("0b2", &.{ .invalid, .integer_literal });1869 try testTokenize("0b2", &.{ .invalid, .integer_literal });
...@@ -1902,7 +1902,7 @@ test "tokenizer - number literals binary" {...@@ -1902,7 +1902,7 @@ test "tokenizer - number literals binary" {
1902 try testTokenize("0b1_,", &.{ .invalid, .comma });1902 try testTokenize("0b1_,", &.{ .invalid, .comma });
1903}1903}
19041904
1905test "tokenizer - number literals octal" {1905test "number literals octal" {
1906 try testTokenize("0o0", &.{.integer_literal});1906 try testTokenize("0o0", &.{.integer_literal});
1907 try testTokenize("0o1", &.{.integer_literal});1907 try testTokenize("0o1", &.{.integer_literal});
1908 try testTokenize("0o2", &.{.integer_literal});1908 try testTokenize("0o2", &.{.integer_literal});
...@@ -1941,7 +1941,7 @@ test "tokenizer - number literals octal" {...@@ -1941,7 +1941,7 @@ test "tokenizer - number literals octal" {
1941 try testTokenize("0o_,", &.{ .invalid, .identifier, .comma });1941 try testTokenize("0o_,", &.{ .invalid, .identifier, .comma });
1942}1942}
19431943
1944test "tokenizer - number literals hexadecimal" {1944test "number literals hexadecimal" {
1945 try testTokenize("0x0", &.{.integer_literal});1945 try testTokenize("0x0", &.{.integer_literal});
1946 try testTokenize("0x1", &.{.integer_literal});1946 try testTokenize("0x1", &.{.integer_literal});
1947 try testTokenize("0x2", &.{.integer_literal});1947 try testTokenize("0x2", &.{.integer_literal});
...@@ -2029,22 +2029,22 @@ test "tokenizer - number literals hexadecimal" {...@@ -2029,22 +2029,22 @@ test "tokenizer - number literals hexadecimal" {
2029 try testTokenize("0x0.0p0_", &.{ .invalid, .eof });2029 try testTokenize("0x0.0p0_", &.{ .invalid, .eof });
2030}2030}
20312031
2032test "tokenizer - multi line string literal with only 1 backslash" {2032test "multi line string literal with only 1 backslash" {
2033 try testTokenize("x \\\n;", &.{ .identifier, .invalid, .semicolon });2033 try testTokenize("x \\\n;", &.{ .identifier, .invalid, .semicolon });
2034}2034}
20352035
2036test "tokenizer - invalid builtin identifiers" {2036test "invalid builtin identifiers" {
2037 try testTokenize("@()", &.{ .invalid, .l_paren, .r_paren });2037 try testTokenize("@()", &.{ .invalid, .l_paren, .r_paren });
2038 try testTokenize("@0()", &.{ .invalid, .integer_literal, .l_paren, .r_paren });2038 try testTokenize("@0()", &.{ .invalid, .integer_literal, .l_paren, .r_paren });
2039}2039}
20402040
2041test "tokenizer - invalid token with unfinished escape right before eof" {2041test "invalid token with unfinished escape right before eof" {
2042 try testTokenize("\"\\", &.{.invalid});2042 try testTokenize("\"\\", &.{.invalid});
2043 try testTokenize("'\\", &.{.invalid});2043 try testTokenize("'\\", &.{.invalid});
2044 try testTokenize("'\\u", &.{.invalid});2044 try testTokenize("'\\u", &.{.invalid});
2045}2045}
20462046
2047test "tokenizer - saturating" {2047test "saturating" {
2048 try testTokenize("<<", &.{.angle_bracket_angle_bracket_left});2048 try testTokenize("<<", &.{.angle_bracket_angle_bracket_left});
2049 try testTokenize("<<|", &.{.angle_bracket_angle_bracket_left_pipe});2049 try testTokenize("<<|", &.{.angle_bracket_angle_bracket_left_pipe});
2050 try testTokenize("<<|=", &.{.angle_bracket_angle_bracket_left_pipe_equal});2050 try testTokenize("<<|=", &.{.angle_bracket_angle_bracket_left_pipe_equal});