-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove whitespace in sdkId for rendering (#58)
- Loading branch information
Jakub Kozłowski
authored
Jan 19, 2022
1 parent
e3d718e
commit d87e412
Showing
4 changed files
with
54 additions
and
14 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
34 changes: 34 additions & 0 deletions
34
modules/codegen/test/src/smithy4s/codegen/SmithyToIRSpec.scala
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,34 @@ | ||
package smithy4s.codegen | ||
|
||
import weaver._ | ||
|
||
object SmithyToIRSpec extends FunSuite { | ||
|
||
test("prettifyName: sdkId takes precedence") { | ||
expect.eql( | ||
SmithyToIR.prettifyName(Some("Example"), "unused"), | ||
"Example" | ||
) | ||
} | ||
test("prettifyName: shapeName is used as a fallback") { | ||
expect.eql( | ||
SmithyToIR.prettifyName(None, "Example"), | ||
"Example" | ||
) | ||
} | ||
|
||
test("prettifyName removes whitespace in sdkId") { | ||
expect.eql( | ||
SmithyToIR.prettifyName(Some("QuickDB \t\nStreams"), "unused"), | ||
"QuickDBStreams" | ||
) | ||
} | ||
|
||
// Not a feature, just verifying the name is unaffected | ||
test("prettifyName ignores whitespace in shape name") { | ||
expect.eql( | ||
SmithyToIR.prettifyName(None, "This Has Spaces"), | ||
"This Has Spaces" | ||
) | ||
} | ||
} |
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