github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/pgwire/hba/testdata/scan (about) 1 subtest token 2 3 token 4 ---- 5 hba.String{} false "" 6 7 8 token 9 # Just a comment. 10 ---- 11 hba.String{} false "" 12 13 token 14 a b 15 ---- 16 hba.String{Value:"a", Quoted:false} false " b" 17 18 token 19 a,b 20 ---- 21 hba.String{Value:"a", Quoted:false} true "b" 22 23 token 24 a, b 25 ---- 26 hba.String{Value:"a", Quoted:false} true " b" 27 28 29 token 30 a ,b 31 ---- 32 hba.String{Value:"a", Quoted:false} false " ,b" 33 34 token 35 abc,def 36 ---- 37 hba.String{Value:"abc", Quoted:false} true "def" 38 39 token 40 "abc",def 41 ---- 42 hba.String{Value:"abc", Quoted:true} true "def" 43 44 token 45 "abc"def 46 ---- 47 hba.String{Value:"abc", Quoted:true} false "def" 48 49 token 50 # abc,def 51 ---- 52 hba.String{} false "" 53 54 token 55 # "abc 56 ---- 57 hba.String{} false "" 58 59 60 token 61 "abc 62 ---- 63 error: unterminated quoted string 64 65 subtest end 66 67 subtest field 68 69 field 70 ---- 71 [] 72 "" 73 74 field 75 # Just a comment. 76 ---- 77 [] 78 "" 79 80 field 81 a b c 82 ---- 83 [a] 84 " b c" 85 86 field 87 a b # c d e 88 ---- 89 [a] 90 " b # c d e" 91 92 field 93 a,b 94 ---- 95 [a b] 96 "" 97 98 field 99 a,b c 100 ---- 101 [a b] 102 " c" 103 104 field 105 a,b, c 106 ---- 107 [a b c] 108 "" 109 110 field 111 a,b ,c 112 ---- 113 [a b] 114 " ,c" 115 116 field 117 a,"b",c d 118 ---- 119 [a "b" c] 120 " d" 121 122 field 123 "a",b,c d 124 ---- 125 ["a" b c] 126 " d" 127 128 field 129 "a","b","c" d 130 ---- 131 ["a" "b" "c"] 132 " d" 133 134 field 135 "a, b ,c" d 136 ---- 137 ["a, b ,c"] 138 " d" 139 140 field 141 all,abc 142 ---- 143 [all abc] 144 "" 145 146 field 147 # all,abc 148 ---- 149 [] 150 "" 151 152 field 153 all,"abc 154 ---- 155 error: unterminated quoted string 156 157 subtest end 158 159 subtest whitespace 160 161 file 162 ---- 163 hba.scannedInput{} 164 165 file 166 # Just a comment. 167 ---- 168 hba.scannedInput{} 169 170 file 171 # 172 173 # comment and empty lines 174 175 # 176 ---- 177 hba.scannedInput{} 178 179 subtest end 180 181 subtest whitespace_around_lines 182 183 file 184 # 185 186 a 187 188 # 189 ---- 190 hba.scannedInput{ 191 lines: { 192 { 193 input: "a", 194 tokens: { 195 { 196 {Value:"a", Quoted:false}, 197 }, 198 }, 199 }, 200 }, 201 linenos: {3}, 202 } 203 204 file 205 # 206 207 a 208 209 # 210 ---- 211 hba.scannedInput{ 212 lines: { 213 { 214 input: "a", 215 tokens: { 216 { 217 {Value:"a", Quoted:false}, 218 }, 219 }, 220 }, 221 }, 222 linenos: {3}, 223 } 224 225 file 226 # 227 228 a 229 230 b # tailing comment + whitespace 231 232 # 233 ---- 234 hba.scannedInput{ 235 lines: { 236 { 237 input: "a", 238 tokens: { 239 { 240 {Value:"a", Quoted:false}, 241 }, 242 }, 243 }, 244 { 245 input: "b # tailing comment + whitespace", 246 tokens: { 247 { 248 {Value:"b", Quoted:false}, 249 }, 250 }, 251 }, 252 }, 253 linenos: {3, 5}, 254 } 255 256 subtest end 257 258 subtest fields 259 260 file 261 a b c 262 ---- 263 hba.scannedInput{ 264 lines: { 265 { 266 input: "a b c", 267 tokens: { 268 { 269 {Value:"a", Quoted:false}, 270 }, 271 { 272 {Value:"b", Quoted:false}, 273 }, 274 { 275 {Value:"c", Quoted:false}, 276 }, 277 }, 278 }, 279 }, 280 linenos: {1}, 281 } 282 283 file 284 a b c 285 d e 286 ---- 287 hba.scannedInput{ 288 lines: { 289 { 290 input: "a b c", 291 tokens: { 292 { 293 {Value:"a", Quoted:false}, 294 }, 295 { 296 {Value:"b", Quoted:false}, 297 }, 298 { 299 {Value:"c", Quoted:false}, 300 }, 301 }, 302 }, 303 { 304 input: "d e", 305 tokens: { 306 { 307 {Value:"d", Quoted:false}, 308 }, 309 { 310 {Value:"e", Quoted:false}, 311 }, 312 }, 313 }, 314 }, 315 linenos: {1, 2}, 316 } 317 318 file 319 # 320 321 a b # c d e 322 323 d e # b c 324 325 # 326 ---- 327 hba.scannedInput{ 328 lines: { 329 { 330 input: "a b # c d e", 331 tokens: { 332 { 333 {Value:"a", Quoted:false}, 334 }, 335 { 336 {Value:"b", Quoted:false}, 337 }, 338 }, 339 }, 340 { 341 input: "d e # b c", 342 tokens: { 343 { 344 {Value:"d", Quoted:false}, 345 }, 346 { 347 {Value:"e", Quoted:false}, 348 }, 349 }, 350 }, 351 }, 352 linenos: {3, 5}, 353 } 354 355 356 subtest end