(t *testing.T)
| 390 | } |
| 391 | |
| 392 | func TestStringConstant(t *testing.T) { |
| 393 | tests := []struct { |
| 394 | c Constant |
| 395 | want string |
| 396 | }{ |
| 397 | { |
| 398 | c: String("Lean down your ear upon the earth and listen."), |
| 399 | want: "Lean down your ear upon the earth and listen.", |
| 400 | }, |
| 401 | { |
| 402 | c: String(`hello world " \\ "`), |
| 403 | want: `hello world " \\ "`, |
| 404 | }, |
| 405 | } |
| 406 | for _, test := range tests { |
| 407 | str, err := test.c.StringValue() |
| 408 | if err != nil { |
| 409 | t.Fatal(err) |
| 410 | } |
| 411 | if str != test.want { |
| 412 | t.Errorf("want %q got %q", test.want, str) |
| 413 | } |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | func TestNumberConstant(t *testing.T) { |
| 418 | c := Number(-42) |
nothing calls this directly
no test coverage detected