Skip to content

Commit

Permalink
Merge branch 'main' into feat/conformance-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Saturn225 authored Nov 6, 2024
2 parents 265e7e6 + dc1f3f4 commit 9b0638e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object Dependencies {
val NettyVersion = "4.1.112.Final"
val NettyIncubatorVersion = "0.0.25.Final"
val ScalaCompactCollectionVersion = "2.12.0"
val ZioVersion = "2.1.9"
val ZioVersion = "2.1.11"
val ZioCliVersion = "0.5.0"
val ZioJsonVersion = "0.7.1"
val ZioParserVersion = "0.1.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ object SizeLimitsSpec extends ZIOHttpSpec {
val DEFAULT_URL_SIZE = 4096
val DEFAULT_HEADER_SIZE = 8192
val DEFAULT_CONTENT_SIZE = 1024 * 100
val ERROR_MARGIN = 3

/*
Checks that for `A` with size until `maxSize`, server responds with `Status.Ok` and `badStatus` after it.
Expand Down Expand Up @@ -63,7 +64,7 @@ object SizeLimitsSpec extends ZIOHttpSpec {
}
info <-
if (expected == status) loop(size + 1, lstTestSize, inc(size)(content), f, expected)
else if (size >= lstTestSize - 2) // adding margin for differences in scala 2 and scala 3
else if (size >= lstTestSize - ERROR_MARGIN) // adding margin for differences in scala 2 and scala 3
ZIO.succeed(((size, expected), Some(content)))
else ZIO.succeed(((size, status), None))
} yield info
Expand All @@ -81,7 +82,7 @@ object SizeLimitsSpec extends ZIOHttpSpec {
(lstWorkingSize1, lstStatus1) = info1
(lstWorkingSize2, lstStatus2) = info2
} yield assertTrue(
maxSize - lstWorkingSize1 <= 2,
maxSize - lstWorkingSize1 <= ERROR_MARGIN,
maxSize - lstWorkingSize1 >= 0,
lstStatus1 == Status.Ok,
lstWorkingSize2 == lstTestSize,
Expand Down

0 comments on commit 9b0638e

Please sign in to comment.