This commit is contained in:
Motiejus Jakštys 2021-05-24 00:11:57 +03:00
parent dff0a38206
commit fa6118d5c7
3 changed files with 11 additions and 6 deletions

View File

@ -56,5 +56,5 @@ func (r *cmdRootFS) Execute(args []string) error {
return err return err
} }
defer out.Close() defer out.Close()
return rootfs.Rootfs(in, out) return rootfs.RootFS(in, out)
} }

View File

@ -1,13 +1,16 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library( go_library(
name = "rootfs_lib", name = "rootfs_lib",
srcs = [ srcs = ["rootfs.go"],
"rootfs.go",
"rootfs_tests.go",
],
importpath = "github.com/motiejus/code/undocker/rootfs", importpath = "github.com/motiejus/code/undocker/rootfs",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
)
go_test(
name = "rootfs_test",
srcs = ["rootfs_test.go"],
embed = [":rootfs"],
deps = [ deps = [
"@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require", "@com_github_stretchr_testify//require",

View File

@ -123,6 +123,8 @@ func TestRootFS(t *testing.T) {
}, },
} }
assert.Fail(t, "foo")
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
in := bytes.NewReader(tt.image.bytes()) in := bytes.NewReader(tt.image.bytes())