From b9b50f0a42b3e0bf53c72b293c02098d7061a59b Mon Sep 17 00:00:00 2001
From: Ted Hahn <ted@lifeonair.com>
Date: Fri, 16 Jun 2017 10:30:32 -0700
Subject: [PATCH] Add extvar to test.

---
 cmd/show_test.go      | 2 ++
 testdata/test.jsonnet | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/cmd/show_test.go b/cmd/show_test.go
index 55017a7b..a715d8ad 100644
--- a/cmd/show_test.go
+++ b/cmd/show_test.go
@@ -45,6 +45,7 @@ func TestShow(t *testing.T) {
   "bool": true,
   "number": 42,
   "string": "bar",
+  "notAVal": "aVal",
   "array": ["one", 2, [3]],
   "object": {"foo": "bar"}
 }
@@ -60,6 +61,7 @@ func TestShow(t *testing.T) {
 			"-J", filepath.FromSlash("../testdata/lib"),
 			"-o", format,
 			filepath.FromSlash("../testdata/test.jsonnet"),
+			"-V", "aVar=aVal",
 		})
 
 		t.Log("output is", output)
diff --git a/testdata/test.jsonnet b/testdata/test.jsonnet
index f98a72df..d0cd6a7f 100644
--- a/testdata/test.jsonnet
+++ b/testdata/test.jsonnet
@@ -1,4 +1,5 @@
 local test = import "test.libsonnet";
+local aVar = std.extVar("aVar");
 
 {
   apiVersion: "v1",
@@ -6,6 +7,7 @@ local test = import "test.libsonnet";
   items: [
     test {
       string: "bar",
+      notAVal : aVar,
     }
   ],
 }
-- 
GitLab