Skip to content

Commit

Permalink
tiltfile: test for top level for loop (#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Miller authored Feb 25, 2019
1 parent 115d3c5 commit e32b301
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/tiltfile/tiltfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,8 @@ k8s_resource('rest', yaml=rest)
f.loadErrString("could not associate any k8s YAML with this resource")
}

// These tests are for behavior that we specifically enabled in Starlark
// in the init() function
func TestTopLevelIfStatement(t *testing.T) {
f := newFixture(t)
defer f.TearDown()
Expand All @@ -994,6 +996,20 @@ if True:
f.assertConfigFiles("Tiltfile", "foo/Dockerfile", "foo.yaml")
}

func TestTopLevelForLoop(t *testing.T) {
f := newFixture(t)
defer f.TearDown()

f.setupFoo()

f.file("Tiltfile", `
for i in range(1, 3):
print(i)
`)

f.load()
}

func TestHelm(t *testing.T) {
f := newFixture(t)
defer f.TearDown()
Expand Down

0 comments on commit e32b301

Please sign in to comment.