summaryrefslogtreecommitdiff
path: root/build/instructions_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'build/instructions_test.go')
-rw-r--r--build/instructions_test.go22
1 files changed, 19 insertions, 3 deletions
diff --git a/build/instructions_test.go b/build/instructions_test.go
index 29508e2..77938dd 100644
--- a/build/instructions_test.go
+++ b/build/instructions_test.go
@@ -37,9 +37,25 @@ func TestCopy(t *testing.T) {
}
func TestCopyAs(t *testing.T) {
- i := build.CopyAs{123, 124, build.Copy{[]string{"source1", "source2"}, "dest"}}
-
- assert.Equal(t, []string{"123:124", `"source1"`, `"source2"`, `"dest"`}, i.Compile())
+ t.Run("wrapping Copy", func(t *testing.T) {
+ i := build.CopyAs{
+ 123,
+ 124,
+ build.Copy{[]string{"source1", "source2"}, "dest"},
+ }
+
+ assert.Equal(t, []string{"123:124", `"source1"`, `"source2"`, `"dest"`}, i.Compile())
+ })
+
+ t.Run("wrapping CopyFrom", func(t *testing.T) {
+ i := build.CopyAs{
+ 123,
+ 124,
+ build.CopyFrom{"foo", build.Copy{[]string{"source1", "source2"}, "dest"}},
+ }
+
+ assert.Equal(t, []string{"123:124", "foo", `"source1"`, `"source2"`, `"dest"`}, i.Compile())
+ })
}
func TestCopyFrom(t *testing.T) {