From f4a61b257cfd1777e26483b5d6d50f227fe9919c Mon Sep 17 00:00:00 2001 From: djherbis Date: Sat, 7 Nov 2015 17:40:36 -0800 Subject: [PATCH] adding tests for HasChangeTime() and HasBirthTime() --- times_test.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/times_test.go b/times_test.go index 4f6abe5..76727c6 100644 --- a/times_test.go +++ b/times_test.go @@ -74,20 +74,28 @@ func TestCheat(t *testing.T) { // this allows us to get 100% test coverage for platforms which do not have // ChangeTime/BirthTime var c ctime - c.ChangeTime() + if c.HasChangeTime() { + c.ChangeTime() + } var b btime - b.BirthTime() + if b.HasBirthTime() { + b.BirthTime() + } var nc noctime func() { - defer func() { recover() }() + if !nc.HasChangeTime() { + defer func() { recover() }() + } nc.ChangeTime() }() var nb nobtime func() { - defer func() { recover() }() + if !nb.HasBirthTime() { + defer func() { recover() }() + } nb.BirthTime() }() }