summaryrefslogtreecommitdiff
path: root/runner/create_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'runner/create_test.go')
-rw-r--r--runner/create_test.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/runner/create_test.go b/runner/create_test.go
new file mode 100644
index 0000000..fc9e535
--- /dev/null
+++ b/runner/create_test.go
@@ -0,0 +1,34 @@
+//go:build test
+
+package runner
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func TestAssertSourceIs_Correct(t *testing.T) {
+ src := TSource("abc", "def")
+ AssertSourceIs(t, "abc", src)
+}
+
+func TestAssertSourceIs_Wrong(t *testing.T) {
+ src := TSource("abc", "def")
+ AssertSourceIsNot(t, ";lkjh", src)
+}
+
+func TestAssertTargetIs_Correct(t *testing.T) {
+ ta := TTarget("aaaa")
+ AssertTargetIs(t, "aaaa", ta)
+}
+
+func TestAssertTargetIs_Wrong(t *testing.T) {
+ ta := TTarget("aaaa")
+ AssertTargetIsNot(t, "bbbbbb", ta)
+}
+
+func TestTTargetIdentity(t *testing.T) {
+ ta := TTarget("asdf.hidden.sh")
+ assert.True(t, ta.Matches("asdf"))
+ assert.False(t, ta.Matches("hidden"))
+}