Serge Bazanski | be538db | 2020-11-12 00:22:42 +0100 | [diff] [blame] | 1 | // Copyright 2017 The kubecfg authors |
| 2 | // |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | |
| 16 | package cmd |
| 17 | |
| 18 | import ( |
| 19 | "regexp" |
| 20 | "testing" |
| 21 | ) |
| 22 | |
| 23 | func TestVersion(t *testing.T) { |
| 24 | output := cmdOutput(t, []string{"version"}) |
| 25 | |
| 26 | // Also a good smoke-test that libjsonnet linked successfully |
| 27 | if !regexp.MustCompile(`jsonnet version: v[\d.]+`).MatchString(output) { |
| 28 | t.Error("Failed to find jsonnet version in:", output) |
| 29 | } |
| 30 | } |