-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add availableSince for every stdlib function and require it in a test…
… so we don't get any more gaps
- Loading branch information
1 parent
5e70ed7
commit 39f8dfa
Showing
6 changed files
with
660 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2015 Google Inc. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
TEST_SUITE_NAME="${TEST_SUITE_NAME:-$0}" | ||
|
||
cd $(dirname $0) | ||
|
||
JSONNET_BIN="${JSONNET_BIN:-../../jsonnet}" | ||
|
||
source ../../test_suite/tests.source | ||
|
||
init | ||
|
||
shopt -s nullglob | ||
|
||
FAILED=0 | ||
SUCCESS=0 | ||
|
||
test_eval "$JSONNET_BIN" "stdlib-content-test.jsonnet" 0 "true" "PLAIN" | ||
|
||
deinit | ||
|
||
if [ "$FAILED" -eq 0 ] ; then | ||
echo "$TEST_SUITE_NAME: All $EXECUTED tests executed correctly." | ||
else | ||
echo "$TEST_SUITE_NAME: $FAILED / $EXECUTED tests failed." | ||
exit 1 | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
local stdlib_content = import 'stdlib-content.jsonnet'; | ||
|
||
std.all([ | ||
if !std.objectHas(field, 'availableSince') then | ||
error 'No availableSince field for std.%s' % field.name | ||
else if field.availableSince[0] == 'v' then | ||
error 'availableSince field for std.%s should not begin with a "v" (got %s)' | ||
% [field.name, field.availableSince] | ||
else | ||
true | ||
for group in stdlib_content.groups | ||
for field in group.fields | ||
]) |
Oops, something went wrong.