Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Morfly committed Jun 14, 2021
1 parent d00550f commit e527c06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ class AndroidDataBindingTemplateTests : ShouldSpec({
package(default_visibility = ["//visibility:public"])
DATABINDING_LAYOUTS = ["src/main/res/layout/layout_lib1.xml"]
VIEW_MODELS_WITH_RES_IMPORTS = []
VIEW_MODELS = ["src/main/kotlin/org/morfly/airin/test/lib1/Lib1ViewModel.kt"] + [
"modify_imports_in_" + view_model_with_res_imports[0:-3]
for view_model_with_res_imports in VIEW_MODELS_WITH_RES_IMPORTS
Expand All @@ -70,17 +68,14 @@ class AndroidDataBindingTemplateTests : ShouldSpec({
]
BINDING_ADAPTERS = ["src/main/kotlin/org/morfly/airin/test/lib1/BindingAdapters.java"]
EXCLUDED_LIB1_FILES = VIEW_MODELS + VIEW_MODELS_WITH_RES_IMPORTS + BINDING_ADAPTERS
LIB1_FILES_WITH_RESOURCE_IMPORTS = glob(
[
"src/main/kotlin/**/*.kt",
"src/main/kotlin/**/*.java",
],
exclude = EXCLUDED_LIB1_FILES,
)
LIB1_FILES = [
"modify_imports_in_" + app_files_with_res_imports[0:-3]
for app_files_with_res_imports in LIB1_FILES_WITH_RESOURCE_IMPORTS
Expand Down Expand Up @@ -169,7 +164,6 @@ class AndroidDataBindingTemplateTests : ShouldSpec({
["src/main/AndroidManifest.xml"],
visibility = ["//:__pkg__"],
)
""".trimIndent()

writer.write(null, file) shouldBe expectedResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AssignmentFormatterTests : ShouldSpec({
val builder = StringBuilder()
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = "\n${___4}VARIABLE = None"
val expectedResult = "${___4}VARIABLE = None"

builder.toString() shouldBe expectedResult
}
Expand All @@ -60,7 +60,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = "value"
""".trimMargin()

Expand All @@ -74,7 +73,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = 1
""".trimMargin()

Expand All @@ -88,7 +86,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = 1.5
""".trimMargin()

Expand All @@ -102,7 +99,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = True
""".trimMargin()

Expand All @@ -115,7 +111,7 @@ class AssignmentFormatterTests : ShouldSpec({
val builder = StringBuilder()
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = "\n${___4}VARIABLE = []"
val expectedResult = "${___4}VARIABLE = []"

builder.toString() shouldBe expectedResult
}
Expand All @@ -130,7 +126,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = ["item"]
""".trimMargin()

Expand All @@ -147,7 +142,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = [
|${_______8}"item1",
|${_______8}"item2",
Expand All @@ -163,7 +157,7 @@ class AssignmentFormatterTests : ShouldSpec({
val builder = StringBuilder()
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = "\n${___4}VARIABLE = {}"
val expectedResult = "${___4}VARIABLE = {}"

builder.toString() shouldBe expectedResult
}
Expand All @@ -178,7 +172,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = {"key": "value"}
""".trimMargin()

Expand All @@ -200,7 +193,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = {
|${_______8}"key1": "value1",
|${_______8}"key2": 2,
Expand All @@ -216,7 +208,7 @@ class AssignmentFormatterTests : ShouldSpec({
val builder = StringBuilder()
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = "\n${___4}VARIABLE = ANOTHER_VARIABLE"
val expectedResult = "${___4}VARIABLE = ANOTHER_VARIABLE"

builder.toString() shouldBe expectedResult
}
Expand All @@ -236,7 +228,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE_3 = VARIABLE_1 + VARIABLE_2
""".trimMargin()

Expand All @@ -258,7 +249,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = "string1" + "string2"
""".trimMargin()

Expand All @@ -280,7 +270,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = [
|${_______8}"item1",
|${_______8}"item2",
Expand Down Expand Up @@ -313,7 +302,6 @@ class AssignmentFormatterTests : ShouldSpec({
formatter.visit(assignment, position = 1, mode = NEW_LINE, builder)

val expectedResult = """
|
|${___4}VARIABLE = {"key1": "value1"} + {
|${_______8}"key2": "value2",
|${_______8}"key3": 3,
Expand Down

0 comments on commit e527c06

Please sign in to comment.