-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix provider coordinates vs token confusion (#306)
Fixes #304
- Loading branch information
1 parent
fe694a2
commit 2b86c0c
Showing
4 changed files
with
60 additions
and
26 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
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
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
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,23 @@ | ||
package besom.codegen | ||
|
||
//noinspection ScalaFileName | ||
class PulumiTokenTest extends munit.FunSuite { | ||
test("apply") { | ||
assertEquals(PulumiToken("aws:ec2:Instance"), PulumiToken("aws", "ec2", "Instance")) | ||
assertEquals(PulumiToken("pulumi:providers:aws"), PulumiToken("pulumi", "providers", "aws")) | ||
assertEquals(PulumiToken("pulumi", "providers", "aws"), PulumiToken("pulumi", "providers", "aws")) | ||
} | ||
test("asString") { | ||
assertEquals(PulumiToken("aws:ec2:Instance").asString, "aws:ec2:Instance") | ||
assertEquals(PulumiToken("provider", "index", "SomeType").asString, "provider:index:SomeType") | ||
} | ||
test("uniformed") { | ||
assertEquals(PulumiToken("aws:ec2:Instance").uniformed, "aws:ec2:instance") | ||
} | ||
|
||
test("enforce non-empty module") { | ||
assertEquals(PulumiToken("provider", "", "SomeType").asString, "provider:index:SomeType") | ||
assertEquals(PulumiToken("provider::SomeType").asString, "provider:index:SomeType") | ||
assertEquals(PulumiToken("provider:SomeType").asString, "provider:index:SomeType") | ||
} | ||
} |