1
1
Fork 0
mirror of https://github.com/mcuadros/ascode synced 2024-05-08 16:46:18 +02:00

starlark/types: fix failing example

This commit is contained in:
Máximo Cuadros 2020-03-27 19:22:44 +01:00
parent a5fc3f257b
commit fd709c4694
No known key found for this signature in database
GPG Key ID: 17A5DFEDC735AE4B
5 changed files with 7 additions and 56 deletions

View File

@ -12,7 +12,7 @@ jobs:
with:
image: mcuadros/ascode
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
username: mcuadros
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Tag image
@ -21,5 +21,5 @@ jobs:
image: mcuadros/ascode
registry: docker.io
tag: latest
username: ${{ secrets.DOCKER_USERNAME }}
username: mcuadros
password: ${{ secrets.DOCKER_PASSWORD }}

View File

@ -3,6 +3,7 @@ on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
go-version: [1.12.x, 1.13.x, 1.14.x]
platform: [ubuntu-latest, macos-latest, windows-latest]

View File

@ -20,8 +20,9 @@ os.remove("foo")
assert.ne(os.getwd(), "")
os.chdir("/tmp")
assert.eq(os.getwd(), "/tmp")
home = os.getenv("HOME")
os.chdir(home)
assert.eq(os.getwd(), home)
os.mkdir_all("foo/bar", 0o755)

View File

@ -1,51 +0,0 @@
# Predeclared built-ins for this module:
#
# error(msg): report an error in Go's test framework without halting execution.
# This is distinct from the built-in fail function, which halts execution.
# catch(f): evaluate f() and returns its evaluation error message, if any
# matches(str, pattern): report whether str matches regular expression pattern.
# module(**kwargs): a constructor for a module.
# _freeze(x): freeze the value x and everything reachable from it.
#
# Clients may use these functions to define their own testing abstractions.
def _eq(x, y):
if x != y:
error("%r != %r" % (x, y))
def _ne(x, y):
if x == y:
error("%r == %r" % (x, y))
def _true(cond, msg = "assertion failed"):
if not cond:
error(msg)
def _lt(x, y):
if not (x < y):
error("%s is not less than %s" % (x, y))
def _contains(x, y):
if y not in x:
error("%s does not contain %s" % (x, y))
def _fails(f, pattern):
"assert_fails asserts that evaluation of f() fails with the specified error."
msg = catch(f)
if msg == None:
error("evaluation succeeded unexpectedly (want error matching %r)" % pattern)
elif not matches(pattern, msg):
error("regular expression (%s) did not match error (%s)" % (pattern, msg))
freeze = _freeze # an exported global whose value is the built-in freeze function
assert = module(
"assert",
fail = error,
eq = _eq,
ne = _ne,
true = _true,
lt = _lt,
contains = _contains,
fails = _fails,
)

View File

@ -4,7 +4,7 @@ def print_provider_info(p):
print(" Defines Resources: %d" % len(dir(p.resource)))
print(" Configuration: %s" % p.__dict__)
provider = tf.provider("google")
provider = tf.provider("google", "3.13.0")
provider.project = "acme-app"
provider.region = "us-central1"