From 74d6fc5e84b21544ec4dec3a46e91b34d5c1083f Mon Sep 17 00:00:00 2001 From: takapi327 Date: Sat, 21 Dec 2024 21:25:11 +0900 Subject: [PATCH] Action sbt scalafmtAll --- .../builder/ColumnCodeBuilderTest.scala | 14 +-- .../builder/DataTypeCodeBuilderTest.scala | 115 ++++++++++++++---- .../ldbc/codegen/parser/yml/ParserTest.scala | 9 +- 3 files changed, 102 insertions(+), 36 deletions(-) diff --git a/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/builder/ColumnCodeBuilderTest.scala b/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/builder/ColumnCodeBuilderTest.scala index 3d2485250..390fb621a 100644 --- a/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/builder/ColumnCodeBuilderTest.scala +++ b/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/builder/ColumnCodeBuilderTest.scala @@ -34,7 +34,7 @@ class ColumnCodeBuilderTest extends CatsEffectSuite: "def p1: Column[String] = column[String](\"p1\", VARCHAR[String](255))" ) } - + test("The construction of Column into a code string matches the specified string.") { val column = ColumnDefinition( "p1", @@ -55,7 +55,7 @@ class ColumnCodeBuilderTest extends CatsEffectSuite: "def p1: Column[Long] = column[Long](\"p1\", BIGINT[Long], AUTO_INCREMENT, PRIMARY_KEY)" ) } - + test("The construction of Column into a code string matches the specified string.") { val column = ColumnDefinition( "p1", @@ -75,7 +75,7 @@ class ColumnCodeBuilderTest extends CatsEffectSuite: "def p1: Column[Long] = column[Long](\"p1\", BIGINT[Long], COMMENT(\"identifier\"))" ) } - + test("The construction of Column into a code string matches the specified string.") { val column = ColumnDefinition( "p1", @@ -95,7 +95,7 @@ class ColumnCodeBuilderTest extends CatsEffectSuite: "def p1: Column[String] = column[String](\"p1\", VARCHAR[String](255), Collate.utf8mb4_bin)" ) } - + test("The construction of Column into a code string matches the specified string.") { val column = ColumnDefinition( "p1", @@ -112,7 +112,7 @@ class ColumnCodeBuilderTest extends CatsEffectSuite: "def p1: Column[String] = column[String](\"p1\", VARCHAR[String](255), VISIBLE)" ) } - + test("The construction of Column into a code string matches the specified string.") { val column = ColumnDefinition( "p1", @@ -132,7 +132,7 @@ class ColumnCodeBuilderTest extends CatsEffectSuite: "def p1: Column[String] = column[String](\"p1\", VARCHAR[String](255), COLUMN_FORMAT.FIXED)" ) } - + test("The construction of Column into a code string matches the specified string.") { val column = ColumnDefinition( "p1", @@ -152,7 +152,7 @@ class ColumnCodeBuilderTest extends CatsEffectSuite: "def p1: Column[String] = column[String](\"p1\", VARCHAR[String](255), STORAGE.DISK)" ) } - + test("The construction of Column into a code string matches the specified string.") { val column = ColumnDefinition("p1", DataType.SERIAL(), None) assertEquals( diff --git a/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/builder/DataTypeCodeBuilderTest.scala b/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/builder/DataTypeCodeBuilderTest.scala index 849bd9d3f..419f40da0 100644 --- a/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/builder/DataTypeCodeBuilderTest.scala +++ b/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/builder/DataTypeCodeBuilderTest.scala @@ -133,10 +133,19 @@ class DataTypeCodeBuilderTest extends CatsEffectSuite: val dataType2 = DataType.CHAR(255, Some("utf8mb4"), None) val dataType3 = DataType.CHAR(255, None, Some("utf8mb4_bin")) val dataType4 = DataType.CHAR(255, None, None) - assertEquals(builder("String").build(dataType1), "CHAR[String](255).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[String]").build(dataType1), "CHAR[Option[String]](255).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("String").build(dataType1), + "CHAR[String](255).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) + assertEquals( + builder("Option[String]").build(dataType1), + "CHAR[Option[String]](255).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("String").build(dataType2), "CHAR[String](255).CHARACTER_SET(Character.utf8mb4)") - assertEquals(builder("Option[String]").build(dataType2), "CHAR[Option[String]](255).CHARACTER_SET(Character.utf8mb4)") + assertEquals( + builder("Option[String]").build(dataType2), + "CHAR[Option[String]](255).CHARACTER_SET(Character.utf8mb4)" + ) assertEquals(builder("String").build(dataType3), "CHAR[String](255).COLLATE(Collate.utf8mb4_bin)") assertEquals(builder("Option[String]").build(dataType3), "CHAR[Option[String]](255).COLLATE(Collate.utf8mb4_bin)") assertEquals(builder("String").build(dataType4), "CHAR[String](255)") @@ -148,12 +157,24 @@ class DataTypeCodeBuilderTest extends CatsEffectSuite: val dataType2 = DataType.VARCHAR(255, Some("utf8mb4"), None) val dataType3 = DataType.VARCHAR(255, None, Some("utf8mb4_bin")) val dataType4 = DataType.VARCHAR(255, None, None) - assertEquals(builder("String").build(dataType1), "VARCHAR[String](255).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[String]").build(dataType1), "VARCHAR[Option[String]](255).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("String").build(dataType1), + "VARCHAR[String](255).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) + assertEquals( + builder("Option[String]").build(dataType1), + "VARCHAR[Option[String]](255).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("String").build(dataType2), "VARCHAR[String](255).CHARACTER_SET(Character.utf8mb4)") - assertEquals(builder("Option[String]").build(dataType2), "VARCHAR[Option[String]](255).CHARACTER_SET(Character.utf8mb4)") + assertEquals( + builder("Option[String]").build(dataType2), + "VARCHAR[Option[String]](255).CHARACTER_SET(Character.utf8mb4)" + ) assertEquals(builder("String").build(dataType3), "VARCHAR[String](255).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[String]").build(dataType3), "VARCHAR[Option[String]](255).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("Option[String]").build(dataType3), + "VARCHAR[Option[String]](255).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("String").build(dataType4), "VARCHAR[String](255)") assertEquals(builder("Option[String]").build(dataType4), "VARCHAR[Option[String]](255)") } @@ -181,10 +202,19 @@ class DataTypeCodeBuilderTest extends CatsEffectSuite: val dataType2 = DataType.TINYTEXT(Some("utf8mb4"), None) val dataType3 = DataType.TINYTEXT(None, Some("utf8mb4_bin")) val dataType4 = DataType.TINYTEXT(None, None) - assertEquals(builder("String").build(dataType1), "TINYTEXT[String]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[String]").build(dataType1), "TINYTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("String").build(dataType1), + "TINYTEXT[String]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) + assertEquals( + builder("Option[String]").build(dataType1), + "TINYTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("String").build(dataType2), "TINYTEXT[String]().CHARACTER_SET(Character.utf8mb4)") - assertEquals(builder("Option[String]").build(dataType2), "TINYTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4)") + assertEquals( + builder("Option[String]").build(dataType2), + "TINYTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4)" + ) assertEquals(builder("String").build(dataType3), "TINYTEXT[String]().COLLATE(Collate.utf8mb4_bin)") assertEquals(builder("Option[String]").build(dataType3), "TINYTEXT[Option[String]]().COLLATE(Collate.utf8mb4_bin)") assertEquals(builder("String").build(dataType4), "TINYTEXT[String]()") @@ -196,12 +226,24 @@ class DataTypeCodeBuilderTest extends CatsEffectSuite: val dataType2 = DataType.ENUM(List("Active", "InActive"), Some("utf8mb4"), None) val dataType3 = DataType.ENUM(List("Active", "InActive"), None, Some("utf8mb4_bin")) val dataType4 = DataType.ENUM(List("Active", "InActive"), None, None) - assertEquals(builder("Status").build(dataType1), "ENUM[Status](using Status).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[Status]").build(dataType1), "ENUM[Option[Status]](using Status).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("Status").build(dataType1), + "ENUM[Status](using Status).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) + assertEquals( + builder("Option[Status]").build(dataType1), + "ENUM[Option[Status]](using Status).CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("Status").build(dataType2), "ENUM[Status](using Status).CHARACTER_SET(Character.utf8mb4)") - assertEquals(builder("Option[Status]").build(dataType2), "ENUM[Option[Status]](using Status).CHARACTER_SET(Character.utf8mb4)") + assertEquals( + builder("Option[Status]").build(dataType2), + "ENUM[Option[Status]](using Status).CHARACTER_SET(Character.utf8mb4)" + ) assertEquals(builder("Status").build(dataType3), "ENUM[Status](using Status).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[Status]").build(dataType3), "ENUM[Option[Status]](using Status).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("Option[Status]").build(dataType3), + "ENUM[Option[Status]](using Status).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("Status").build(dataType4), "ENUM[Status](using Status)") assertEquals(builder("Option[Status]").build(dataType4), "ENUM[Option[Status]](using Status)") } @@ -220,8 +262,14 @@ class DataTypeCodeBuilderTest extends CatsEffectSuite: val dataType2 = DataType.TEXT(None, Some("utf8mb4"), None) val dataType3 = DataType.TEXT(Some(255), None, Some("utf8mb4_bin")) val dataType4 = DataType.TEXT(None, None, None) - assertEquals(builder("String").build(dataType1), "TEXT[String]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[String]").build(dataType1), "TEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("String").build(dataType1), + "TEXT[String]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) + assertEquals( + builder("Option[String]").build(dataType1), + "TEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("String").build(dataType2), "TEXT[String]().CHARACTER_SET(Character.utf8mb4)") assertEquals(builder("Option[String]").build(dataType2), "TEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4)") assertEquals(builder("String").build(dataType3), "TEXT[String]().COLLATE(Collate.utf8mb4_bin)") @@ -241,12 +289,24 @@ class DataTypeCodeBuilderTest extends CatsEffectSuite: val dataType2 = DataType.MEDIUMTEXT(Some("utf8mb4"), None) val dataType3 = DataType.MEDIUMTEXT(None, Some("utf8mb4_bin")) val dataType4 = DataType.MEDIUMTEXT(None, None) - assertEquals(builder("String").build(dataType1), "MEDIUMTEXT[String]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[String]").build(dataType1), "MEDIUMTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("String").build(dataType1), + "MEDIUMTEXT[String]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) + assertEquals( + builder("Option[String]").build(dataType1), + "MEDIUMTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("String").build(dataType2), "MEDIUMTEXT[String]().CHARACTER_SET(Character.utf8mb4)") - assertEquals(builder("Option[String]").build(dataType2), "MEDIUMTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4)") + assertEquals( + builder("Option[String]").build(dataType2), + "MEDIUMTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4)" + ) assertEquals(builder("String").build(dataType3), "MEDIUMTEXT[String]().COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[String]").build(dataType3), "MEDIUMTEXT[Option[String]]().COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("Option[String]").build(dataType3), + "MEDIUMTEXT[Option[String]]().COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("String").build(dataType4), "MEDIUMTEXT[String]()") assertEquals(builder("Option[String]").build(dataType4), "MEDIUMTEXT[Option[String]]()") } @@ -262,10 +322,19 @@ class DataTypeCodeBuilderTest extends CatsEffectSuite: val dataType2 = DataType.LONGTEXT(Some("utf8mb4"), None) val dataType3 = DataType.LONGTEXT(None, Some("utf8mb4_bin")) val dataType4 = DataType.LONGTEXT(None, None) - assertEquals(builder("String").build(dataType1), "LONGTEXT[String]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") - assertEquals(builder("Option[String]").build(dataType1), "LONGTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)") + assertEquals( + builder("String").build(dataType1), + "LONGTEXT[String]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) + assertEquals( + builder("Option[String]").build(dataType1), + "LONGTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4).COLLATE(Collate.utf8mb4_bin)" + ) assertEquals(builder("String").build(dataType2), "LONGTEXT[String]().CHARACTER_SET(Character.utf8mb4)") - assertEquals(builder("Option[String]").build(dataType2), "LONGTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4)") + assertEquals( + builder("Option[String]").build(dataType2), + "LONGTEXT[Option[String]]().CHARACTER_SET(Character.utf8mb4)" + ) assertEquals(builder("String").build(dataType3), "LONGTEXT[String]().COLLATE(Collate.utf8mb4_bin)") assertEquals(builder("Option[String]").build(dataType3), "LONGTEXT[Option[String]]().COLLATE(Collate.utf8mb4_bin)") assertEquals(builder("String").build(dataType4), "LONGTEXT[String]()") diff --git a/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/parser/yml/ParserTest.scala b/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/parser/yml/ParserTest.scala index 5a5dcc479..ddcee5373 100644 --- a/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/parser/yml/ParserTest.scala +++ b/module/ldbc-codegen/shared/src/test/scala/ldbc/codegen/parser/yml/ParserTest.scala @@ -24,8 +24,7 @@ class ParserTest extends CatsEffectSuite: ) ) ) - val parsed = Parser.parse( - """ + val parsed = Parser.parse(""" |database: | name: 'test' | tables: @@ -57,8 +56,7 @@ class ParserTest extends CatsEffectSuite: ) ) ) - val parsed = Parser.parse( - """ + val parsed = Parser.parse(""" |database: | name: 'test' | tables: @@ -84,8 +82,7 @@ class ParserTest extends CatsEffectSuite: ) ) ) - val parsed = Parser.parse( - """ + val parsed = Parser.parse(""" |database: | name: 'test' | tables: