Debian Codegraph @

gopls/internal/test/marker/testdata/hover/basiclit.txt

raw
1 This test checks gopls behavior when hovering over basic literals.
2
3 Skipped on ppc64 as there appears to be a bug on aix-ppc64: golang/go#67526.
4
5 -- flags --
6 -skip_goarch=ppc64
7
8 -- basiclit.go --
9 package basiclit
10
11 func _() {
12 _ = 'a' //@hover("'a'", "'a'", latinA)
13 _ = 0x61 //@hover("0x61", "0x61", latinAHex)
14
15 _ = '\u2211' //@hover("'\\u2211'", "'\\u2211'", summation)
16 _ = '\u2211' //@hover(re"u22()11", "'\\u2211'", summation)
17 _ = 0x2211 //@hover("0x2211", "0x2211", summationHex)
18 _ = "foo \u2211 bar" //@hover("\\u2211", "\\u2211", summation)
19
20 _ = '\a' //@hover("'\\a'", "'\\a'", control)
21 _ = "foo \a bar" //@hover("\\a", "\\a", control)
22
23 _ = '\U0001F30A' //@hover("'\\U0001F30A'", "'\\U0001F30A'", waterWave)
24 _ = 0x0001F30A //@hover("0x0001F30A", "0x0001F30A", waterWaveHex)
25 _ = 0X0001F30A //@hover("0X0001F30A", "0X0001F30A", waterWaveHex)
26 _ = "foo \U0001F30A bar" //@hover("\\U0001F30A", "\\U0001F30A", waterWave)
27
28 _ = '\x7E' //@hover("'\\x7E'", "'\\x7E'", tilde)
29 _ = "foo \x7E bar" //@hover("\\x7E", "\\x7E", tilde)
30 _ = "foo \a bar" //@hover("\\a", "\\a", control)
31
32 _ = '\173' //@hover("'\\173'", "'\\173'", leftCurly)
33 _ = "foo \173 bar" //@hover("\\173","\\173", leftCurly)
34 _ = "foo \173 bar \u2211 baz" //@hover("\\173","\\173", leftCurly)
35 _ = "foo \173 bar \u2211 baz" //@hover("\\u2211","\\u2211", summation)
36 _ = "foo\173bar\u2211baz" //@hover("\\173","\\173", leftCurly)
37 _ = "foo\173bar\u2211baz" //@hover("\\u2211","\\u2211", summation)
38
39 // incorrect position
40 _ = "foo\173bar\u2211baz" //@hover("az",_,_)
41
42 // search for runes in string only if there is an escaped sequence
43 _ = "hello" //@hover(`"hello"`, _, _)
44
45 // incorrect escaped rune sequences
46 _ = '\0' //@hover("'\\0'", _, _),diag(re`\\0()'`, re"illegal character")
47 _ = '\u22111' //@hover("'\\u22111'", _, _)
48 _ = '\U00110000' //@hover("'\\U00110000'", _, _)
49 _ = '\u12e45'//@hover("'\\u12e45'", _, _)
50 _ = '\xa' //@hover("'\\xa'", _, _)
51 _ = 'aa' //@hover("'aa'", _, _)
52
53 // other basic lits
54 _ = 1 //@hover("1", _, _)
55 _ = 1.2 //@hover("1.2", _, _)
56 _ = 1.2i //@hover("1.2i", _, _)
57 _ = 0123 //@hover("0123", _, _)
58 _ = 0b1001 //@hover("0b", "0b1001", binaryNumber)
59 _ = 0B1001 //@hover("0B", "0B1001", binaryNumber)
60 _ = 0o77 //@hover("0o", "0o77", octalNumber)
61 _ = 0O77 //@hover("0O", "0O77", octalNumber)
62 _ = 0x1234567890 //@hover("0x1234567890", "0x1234567890", hexNumber)
63 _ = 0X1234567890 //@hover("0X1234567890", "0X1234567890", hexNumber)
64 _ = 0x1000000000000000000 //@hover("0x1", "0x1000000000000000000", bigHex)
65 }
66 -- @bigHex --
67 4722366482869645213696
68 -- @binaryNumber --
69 9
70 -- @control --
71 U+0007, control
72 -- @hexNumber --
73 78187493520
74 -- @latinA --
75 'a', U+0061, LATIN SMALL LETTER A
76 -- @latinAHex --
77 97, 'a', U+0061, LATIN SMALL LETTER A
78 -- @leftCurly --
79 '{', U+007B, LEFT CURLY BRACKET
80 -- @octalNumber --
81 63
82 -- @summation --
83 '∑', U+2211, N-ARY SUMMATION
84 -- @summationHex --
85 8721, '∑', U+2211, N-ARY SUMMATION
86 -- @tilde --
87 '~', U+007E, TILDE
88 -- @waterWave --
89 '🌊', U+1F30A, WATER WAVE
90 -- @waterWaveHex --
91 127754, '🌊', U+1F30A, WATER WAVE