(t *testing.T)
| 692 | } |
| 693 | |
| 694 | func TestEffectiveTimeNowNoMutation(t *testing.T) { |
| 695 | then := now |
| 696 | t.Cleanup(func() { |
| 697 | now = then |
| 698 | }) |
| 699 | |
| 700 | epoch := time.Unix(0, 0).UTC() |
| 701 | now = func() time.Time { return epoch } |
| 702 | |
| 703 | p, err := NewOfflinePolicy(context.Background(), Now) |
| 704 | assert.NoError(t, err) |
| 705 | |
| 706 | assert.Equal(t, epoch, p.EffectiveTime()) |
| 707 | |
| 708 | p.AttestationTime(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)) |
| 709 | |
| 710 | assert.Equal(t, epoch, p.EffectiveTime()) |
| 711 | } |
| 712 | |
| 713 | func TestEffectiveTimeGivenNoMutation(t *testing.T) { |
| 714 | epoch := time.Unix(0, 0).UTC() |
nothing calls this directly
no test coverage detected