Changeset View
Changeset View
Standalone View
Standalone View
build/macros_test.go
package build_test | package build_test | ||||
import ( | import ( | ||||
"testing" | "testing" | ||||
"github.com/stretchr/testify/assert" | "github.com/stretchr/testify/assert" | ||||
"phabricator.wikimedia.org/source/blubber/build" | "phabricator.wikimedia.org/source/blubber/build" | ||||
) | ) | ||||
func TestApplyUser(t *testing.T) { | func TestApplyUser(t *testing.T) { | ||||
instructions := []build.Instruction{ | instructions := []build.Instruction{ | ||||
build.Copy{[]string{"foo"}, "bar"}, | build.Copy{[]string{"foo"}, "bar"}, | ||||
build.Copy{[]string{"baz"}, "qux"}, | build.Copy{[]string{"baz"}, "qux"}, | ||||
build.CopyFrom{"foo", build.Copy{[]string{"a"}, "b"}}, | |||||
} | } | ||||
assert.Equal(t, | assert.Equal(t, | ||||
[]build.Instruction{ | []build.Instruction{ | ||||
build.CopyAs{123, 223, build.Copy{[]string{"foo"}, "bar"}}, | build.CopyAs{123, 223, build.Copy{[]string{"foo"}, "bar"}}, | ||||
build.CopyAs{123, 223, build.Copy{[]string{"baz"}, "qux"}}, | build.CopyAs{123, 223, build.Copy{[]string{"baz"}, "qux"}}, | ||||
build.CopyAs{123, 223, build.CopyFrom{"foo", build.Copy{[]string{"a"}, "b"}}}, | |||||
}, | }, | ||||
build.ApplyUser(123, 223, instructions), | build.ApplyUser(123, 223, instructions), | ||||
) | ) | ||||
} | } | ||||
func TestChown(t *testing.T) { | func TestChown(t *testing.T) { | ||||
i := build.Chown(123, 124, "/foo") | i := build.Chown(123, 124, "/foo") | ||||
Show All 33 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 3.0 (CC-BY-SA) unless otherwise noted; code licensed under GNU General Public License (GPL) or other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL