(t *testing.T)
| 471 | } |
| 472 | |
| 473 | func TestEnvironment_Time(t *testing.T) { |
| 474 | cases := []struct { |
| 475 | put interface{} |
| 476 | get time.Time |
| 477 | result chainResult |
| 478 | }{ |
| 479 | { |
| 480 | put: time.Unix(9999999, 0), |
| 481 | get: time.Unix(9999999, 0), |
| 482 | result: success, |
| 483 | }, |
| 484 | { |
| 485 | put: 9999999, |
| 486 | get: time.Unix(0, 0), |
| 487 | result: failure, |
| 488 | }, |
| 489 | { |
| 490 | put: time.Unix(9999999, 0).String(), |
| 491 | get: time.Unix(0, 0), |
| 492 | result: failure, |
| 493 | }, |
| 494 | } |
| 495 | for _, tc := range cases { |
| 496 | t.Run(fmt.Sprintf("%T-%v", tc.put, tc.put), |
| 497 | func(t *testing.T) { |
| 498 | env := newEnvironment(newMockChain(t)) |
| 499 | |
| 500 | env.Put("key", tc.put) |
| 501 | env.chain.assert(t, success) |
| 502 | |
| 503 | val := env.GetTime("key") |
| 504 | assert.Equal(t, tc.get, val) |
| 505 | |
| 506 | env.chain.assert(t, tc.result) |
| 507 | }) |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | func TestEnvironment_List(t *testing.T) { |
| 512 | env := newEnvironment(newMockChain(t)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…