-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add more test cases on format tool behavior
Signed-off-by: xiarui.xr <[email protected]>
- Loading branch information
1 parent
4486c08
commit fbe29e1
Showing
8 changed files
with
68 additions
and
1 deletion.
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
8 changes: 8 additions & 0 deletions
8
kclvm/tools/src/format/test_data/format_data/different_stmts_line_breaks.golden
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,8 @@ | ||
import a | ||
|
||
schema A: | ||
name: str = a.name | ||
|
||
A {} | ||
|
||
# Break one blank line between different statements e.g., import, schema and expression statements. |
6 changes: 6 additions & 0 deletions
6
kclvm/tools/src/format/test_data/format_data/different_stmts_line_breaks.input
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,6 @@ | ||
import a | ||
schema A: | ||
name: str = a.name | ||
A{} | ||
|
||
# Break one blank line between different statements e.g., import, schema and expression statements. |
20 changes: 20 additions & 0 deletions
20
kclvm/tools/src/format/test_data/format_data/list_dict_schema_expr.golden
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,20 @@ | ||
dict = { | ||
"key": "value" | ||
} | ||
|
||
dict2 = {"key": "value"} | ||
|
||
list = [ | ||
first | ||
second | ||
] | ||
|
||
list2 = [first, second] | ||
|
||
expr = Person { | ||
name: "Alice" | ||
} | ||
|
||
expr2 = Person {name: "Alice"} | ||
|
||
# It's both acceptable to write each entry in the list/dict/schema expr without line breaks, or separate each entry with one line break. |
20 changes: 20 additions & 0 deletions
20
kclvm/tools/src/format/test_data/format_data/list_dict_schema_expr.input
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,20 @@ | ||
dict = { | ||
"key": "value" | ||
} | ||
|
||
dict2 = {"key": "value"} | ||
|
||
list = [ | ||
first | ||
second | ||
] | ||
|
||
list2 = [first, second] | ||
|
||
expr = Person { | ||
name: "Alice" | ||
} | ||
|
||
expr2 = Person {name: "Alice"} | ||
|
||
# It's both acceptable to write each entry in the list/dict/schema expr without line breaks, or separate each entry with one line break. |
5 changes: 5 additions & 0 deletions
5
kclvm/tools/src/format/test_data/format_data/union_types.golden
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,5 @@ | ||
workloadType: "Deployment" | "StatefulSet" = "Deployment" | ||
ServiceType: "LoadBalance" | "ClusterIP" = "LoadBalance" | ||
abc: A | B | C = A {} | ||
|
||
# In union types, there should be one and only one whitespace both before and after the union operator | |
5 changes: 5 additions & 0 deletions
5
kclvm/tools/src/format/test_data/format_data/union_types.input
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,5 @@ | ||
workloadType: "Deployment"|"StatefulSet" = "Deployment" | ||
ServiceType: "LoadBalance" |"ClusterIP" = "LoadBalance" | ||
abc: A|B|C = A{} | ||
|
||
# In union types, there should be one and only one whitespace both before and after the union operator | |
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