(t *testing.T)
| 363 | } |
| 364 | |
| 365 | func TestValue_GetString(t *testing.T) { |
| 366 | type myString string |
| 367 | |
| 368 | cases := []struct { |
| 369 | name string |
| 370 | data interface{} |
| 371 | result chainResult |
| 372 | expectedString string |
| 373 | }{ |
| 374 | { |
| 375 | name: "string", |
| 376 | data: "foo", |
| 377 | result: success, |
| 378 | expectedString: "foo", |
| 379 | }, |
| 380 | { |
| 381 | name: "myString", |
| 382 | data: myString("foo"), |
| 383 | result: success, |
| 384 | expectedString: "foo", |
| 385 | }, |
| 386 | } |
| 387 | |
| 388 | for _, tc := range cases { |
| 389 | t.Run(tc.name, func(t *testing.T) { |
| 390 | reporter := newMockReporter(t) |
| 391 | |
| 392 | value := NewValue(reporter, tc.data) |
| 393 | inner := value.String() |
| 394 | |
| 395 | value.chain.assert(t, tc.result) |
| 396 | inner.chain.assert(t, tc.result) |
| 397 | |
| 398 | if tc.result { |
| 399 | assert.Equal(t, tc.expectedString, inner.Raw()) |
| 400 | } |
| 401 | }) |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | func TestValue_GetNumber(t *testing.T) { |
| 406 | type myInt int |
nothing calls this directly
no test coverage detected
searching dependent graphs…