Skip to content

Commit

Permalink
[refined4s-pureconfig] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Apr 7, 2024
1 parent 9393195 commit bcdfdb2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2471,8 +2471,10 @@ object autoSpec extends Properties {
def testConfigReaderNonBlankString: Property =
for {
nonWhitespaceString <- Gen
.string(hedgehog.extra.Gens.genNonWhitespaceChar, Range.linear(1, 10))
.map(s => if s.forall(_ === '\u0000') then "blah" else s)
.string(
hedgehog.extra.Gens.genCharByRange(hedgehog.extra.common.NonWhitespaceCharRange.drop(2)),
Range.linear(1, 10),
)
.log("nonWhitespaceString")
whitespaceString <- Gen
.string(
Expand Down Expand Up @@ -2575,8 +2577,10 @@ object autoSpec extends Properties {
def testConfigWriterNonBlankString: Property =
for {
nonWhitespaceString <- Gen
.string(hedgehog.extra.Gens.genNonWhitespaceChar, Range.linear(1, 10))
.map(s => if s === "\u0000" then "blah" else s)
.string(
hedgehog.extra.Gens.genCharByRange(hedgehog.extra.common.NonWhitespaceCharRange.drop(2)),
Range.linear(1, 10),
)
.log("nonWhitespaceString")
whitespaceString <- Gen
.string(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2405,8 +2405,10 @@ object allSpec extends Properties {
def testConfigReaderNonBlankString: Property =
for {
nonWhitespaceString <- Gen
.string(hedgehog.extra.Gens.genNonWhitespaceChar, Range.linear(1, 10))
.map(s => if s.forall(_ === '\u0000') then "blah" else s)
.string(
hedgehog.extra.Gens.genCharByRange(hedgehog.extra.common.NonWhitespaceCharRange.drop(2)),
Range.linear(1, 10),
)
.log("nonWhitespaceString")
whitespaceString <- Gen
.string(
Expand Down Expand Up @@ -2509,8 +2511,10 @@ object allSpec extends Properties {
def testConfigWriterNonBlankString: Property =
for {
nonWhitespaceString <- Gen
.string(hedgehog.extra.Gens.genNonWhitespaceChar, Range.linear(1, 10))
.map(s => if s === "\u0000" then "blah" else s)
.string(
hedgehog.extra.Gens.genCharByRange(hedgehog.extra.common.NonWhitespaceCharRange.drop(2)),
Range.linear(1, 10),
)
.log("nonWhitespaceString")
whitespaceString <-
Gen.string(hedgehog.extra.Gens.genCharByRange(strings.WhitespaceCharRange), Range.linear(1, 10)).log("whitespaceString")
Expand Down

0 comments on commit bcdfdb2

Please sign in to comment.