From 984254e78e6783f234d2959fe1c6cd32884c3ad4 Mon Sep 17 00:00:00 2001 From: Thomas Hahn <Thahn@tcbtech.com> Date: Wed, 28 Jun 2017 23:44:21 -0700 Subject: [PATCH] Test for ext-str-file --- cmd/show_test.go | 2 ++ testdata/extvar.file | 1 + testdata/test.jsonnet | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 testdata/extvar.file diff --git a/cmd/show_test.go b/cmd/show_test.go index 924c3717..732a0bdd 100644 --- a/cmd/show_test.go +++ b/cmd/show_test.go @@ -48,6 +48,7 @@ func TestShow(t *testing.T) { "string": "bar", "notAVal": "aVal", "notAnotherVal": "aVal2", + "filevar": "foo", "array": ["one", 2, [3]], "object": {"foo": "bar"} } @@ -68,6 +69,7 @@ func TestShow(t *testing.T) { filepath.FromSlash("../testdata/test.jsonnet"), "-V", "aVar=aVal", "-V", "anVar", + "--ext-str-file", "filevar=../testdata/extvar.file", }) t.Log("output is", output) diff --git a/testdata/extvar.file b/testdata/extvar.file new file mode 100644 index 00000000..19102815 --- /dev/null +++ b/testdata/extvar.file @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/testdata/test.jsonnet b/testdata/test.jsonnet index fe1c002f..0d5887e2 100644 --- a/testdata/test.jsonnet +++ b/testdata/test.jsonnet @@ -1,6 +1,7 @@ local test = import "test.libsonnet"; local aVar = std.extVar("aVar"); local anVar = std.extVar("anVar"); +local filevar = std.extVar("filevar"); { apiVersion: "v1", @@ -10,6 +11,7 @@ local anVar = std.extVar("anVar"); string: "bar", notAVal : aVar, notAnotherVal : anVar, + filevar : filevar, } ], } -- GitLab