diff options
| author | Shulhan <ms@kilabit.info> | 2021-03-14 22:37:59 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-03-14 22:40:05 +0700 |
| commit | e7552ad0189f761875bc1c2ca3dd716d43a01e0d (patch) | |
| tree | fd68ec29d23fb9a807a7382088020e3b17d446fd /lib/memfs/memfs_test.go | |
| parent | 882727d89c8e7f9b9761009ccdca1af8c18d0a30 (diff) | |
| download | pakakeh.go-e7552ad0189f761875bc1c2ca3dd716d43a01e0d.tar.xz | |
all: refactoring the test.Assert and test.AssertBench signature
Previously, the test.Assert and test.AssertBench functions has the
boolean parameter to print the stack trace of test in case its not equal.
Since this parameter is not mandatory and its usually always set to
"true", we remove them from function signature to simplify the call
to Assert and AssertBench.
Diffstat (limited to 'lib/memfs/memfs_test.go')
| -rw-r--r-- | lib/memfs/memfs_test.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/memfs/memfs_test.go b/lib/memfs/memfs_test.go index e158a9ef..fade66c9 100644 --- a/lib/memfs/memfs_test.go +++ b/lib/memfs/memfs_test.go @@ -70,7 +70,7 @@ func TestAddFile(t *testing.T) { got, err := mfs.AddFile(c.intPath, c.extPath) if err != nil { - test.Assert(t, "error", c.expError, err.Error(), true) + test.Assert(t, "error", c.expError, err.Error()) continue } @@ -81,7 +81,7 @@ func TestAddFile(t *testing.T) { got.Childs = nil } - test.Assert(t, "AddFile", c.exp, got, true) + test.Assert(t, "AddFile", c.exp, got) if c.exp == nil { continue @@ -99,7 +99,7 @@ func TestAddFile(t *testing.T) { got.Childs = nil } - test.Assert(t, "Get", c.exp, got, true) + test.Assert(t, "Get", c.exp, got) } } @@ -178,16 +178,16 @@ func TestGet(t *testing.T) { got, err := mfs.Get(c.path) if err != nil { - test.Assert(t, "error", c.expErr, err, true) + test.Assert(t, "error", c.expErr, err) continue } if got.size <= opts.MaxFileSize { - test.Assert(t, "node.V", c.expV, got.V, true) + test.Assert(t, "node.V", c.expV, got.V) } test.Assert(t, "node.ContentType", c.expContentType, - got.ContentType, true) + got.ContentType) } } @@ -282,12 +282,12 @@ func TestMemFS_mount(t *testing.T) { mfs, err := New(&c.opts) if err != nil { - test.Assert(t, "error", c.expErr, err.Error(), true) + test.Assert(t, "error", c.expErr, err.Error()) continue } gotListNames := mfs.ListNames() - test.Assert(t, "names", c.expMapKeys, gotListNames, true) + test.Assert(t, "names", c.expMapKeys, gotListNames) } } @@ -420,7 +420,7 @@ func TestFilter(t *testing.T) { got := mfs.isIncluded(sysPath, fi.Mode()) - test.Assert(t, sysPath, c.exp[x], got, true) + test.Assert(t, sysPath, c.exp[x], got) } } } |
