Skip to content

Commit

Permalink
Add input variable test (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frassle committed Nov 14, 2022
1 parent 112733d commit dd20ba6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/tf2pulumi/convert/eject_test.go
Expand Up @@ -136,6 +136,7 @@ func TestEject(t *testing.T) {
if assert.NoError(t, err) {
// normalize windows newlines
expectedPcl := strings.Replace(string(pclBytes), "\r\n", "\n", -1)
source = strings.Replace(source, "\r\n", "\n", -1)
assert.Equal(t, expectedPcl, source)
delete(pclFiles, filename)
}
Expand Down
15 changes: 15 additions & 0 deletions pkg/tf2pulumi/convert/testdata/simple_input/main.tf
@@ -0,0 +1,15 @@
variable "opt_str_in" {
default = "some string"
}

variable "number_in" {
type = number
}

output "region_out" {
value = var.opt_str_in
}

output "number_out" {
value = var.number_in
}
11 changes: 11 additions & 0 deletions pkg/tf2pulumi/convert/testdata/simple_input/pcl/main.pp
@@ -0,0 +1,11 @@
config optStrIn string {
default = "some string"
}
config numberIn number {
}
output regionOut {
value = optStrIn
}
output numberOut {
value = numberIn
}

0 comments on commit dd20ba6

Please sign in to comment.