Skip to content

Commit

Permalink
Merge pull request #216 from softwaremill/update/scalafmt-core-3.9.2
Browse files Browse the repository at this point in the history
Update scalafmt-core to 3.9.2
  • Loading branch information
adamw authored Mar 4, 2025
2 parents 88a4a3b + 2cc9610 commit 93c13a3
Show file tree
Hide file tree
Showing 8 changed files with 628 additions and 472 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

# Scala Steward: Reformat with scalafmt 3.7.14
ece31cc91dfbb7f55e1dd9080ef914e3a00ce20a

# Scala Steward: Reformat with scalafmt 3.9.2
01e4ad0b91afd01bff3e74cd1594b6f2e590aad2
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
runner.dialect = scala3
version = 3.7.17
version = 3.9.2
maxColumn = 120
23 changes: 14 additions & 9 deletions apispec-model/src/test/scala/sttp/apispec/SchemaTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,25 @@ class SchemaTest extends AnyFunSuite {
}

test("nullable enum") {
val schema = Schema(`type` = Some(List(SchemaType.String)), `enum` = Some(List("a", "b").map(ExampleSingleValue(_))))
assert(schema.nullable == Schema(
`type` = Some(List(SchemaType.String, SchemaType.Null)),
`enum` = Some(List("a", "b", "null").map(ExampleSingleValue(_)))
))
val schema =
Schema(`type` = Some(List(SchemaType.String)), `enum` = Some(List("a", "b").map(ExampleSingleValue(_))))
assert(
schema.nullable == Schema(
`type` = Some(List(SchemaType.String, SchemaType.Null)),
`enum` = Some(List("a", "b", "null").map(ExampleSingleValue(_)))
)
)
assert(schema.nullable.nullable == schema.nullable) // idempotency
}

test("nullable const") {
val schema = Schema(`type` = Some(List(SchemaType.String)), `const` = Some(ExampleSingleValue("a")))
assert(schema.nullable == Schema(
`type` = Some(List(SchemaType.String, SchemaType.Null)),
`enum` = Some(List("a", "null").map(ExampleSingleValue(_)))
))
assert(
schema.nullable == Schema(
`type` = Some(List(SchemaType.String, SchemaType.Null)),
`enum` = Some(List("a", "null").map(ExampleSingleValue(_)))
)
)
assert(schema.nullable.nullable == schema.nullable)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,3 @@ class BoundsTest extends AnyFunSuite {
assert(!b.contains(Bounds(Some(Bound.exclusive(-1)), Some(Bound.exclusive(11)))))
}
}


Loading

0 comments on commit 93c13a3

Please sign in to comment.