forked from evolution-gaming/play-json-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stacksafe play -> circe AST conversion
- Loading branch information
Maksym Fedorov
committed
Jan 31, 2023
1 parent
6b81358
commit 8858fd0
Showing
3 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...irce/src/test/scala/com/evolutiongaming/util/PlayCirceAstConversionsStackSafetySpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.evolutiongaming.util | ||
|
||
import com.evolutiongaming.util.PlayCirceAstConversions._ | ||
import org.scalatest.freespec.AnyFreeSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import org.scalatest.prop.TableDrivenPropertyChecks | ||
import play.api.libs.json.{JsObject, Json} | ||
|
||
class PlayCirceAstConversionsStackSafetySpec extends AnyFreeSpec with TableDrivenPropertyChecks with Matchers { | ||
"Play to Circe AST conversion" - { | ||
"can handle deeply nested structures" in { | ||
val playJson = (1 to 100000).foldLeft(JsObject.empty)((o, _) => Json.obj("n" -> o)) | ||
assert(playToCirce(playJson).isObject) | ||
} | ||
|
||
"can handle long arrays" in { | ||
val playJson = Json.arr(1 to 100000) | ||
assert(playToCirce(playJson).isArray) | ||
} | ||
} | ||
} |