Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test-data/** linguist-generated=true
1 change: 1 addition & 0 deletions test-data/minified.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 16 additions & 5 deletions util.test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@
import os.Path

class Test extends munit.FunSuite {
val testRecordId = "ENTOCR13RSCLZ6KU"
val expectedVersion = 1.88
val util = JsonUtility.instance

test("should read test file and find data") {
val testRecordId = "ENTOCR13RSCLZ6KU"
val expectedVersion = 1.88
val util = JsonUtility.instance
val testFilePath = os.pwd / "test-data" / "1MB.json"
val result = util
val testFilePath = os.pwd / "test-data" / "1MB.json"
val result = util
.findInFile(testFilePath)(_.id == testRecordId)
.map(_.version)

assert(result == Some(expectedVersion))
}

test("should read minified test file and find data") {

val testFilePath = os.pwd / "test-data" / "minified.json"
val result = util
.findInFile(testFilePath)(_.id == testRecordId)
.map(_.version)

Expand Down