-
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.
- Loading branch information
Showing
25 changed files
with
232 additions
and
65 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
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
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
100 changes: 100 additions & 0 deletions
100
coreTests/shared/src/test/scala/molecule/coreTests/spi/partitions/PartitionTests.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,100 @@ | ||
package molecule.coreTests.spi.partitions | ||
|
||
import molecule.core.api.ApiAsync | ||
import molecule.core.spi.SpiAsync | ||
import molecule.core.util.Executor._ | ||
import molecule.coreTests.async._ | ||
import molecule.coreTests.dataModels.core.dsl.Partitions._ | ||
import molecule.coreTests.setup.CoreTestSuite | ||
import utest._ | ||
|
||
|
||
trait PartitionTests extends CoreTestSuite with ApiAsync { spi: SpiAsync => | ||
|
||
lazy val tests = Tests { | ||
|
||
"Nested 2 levels" - partition { implicit conn => | ||
for { | ||
_ <- lit_Book.title.Reviewers.name.Professions.*(gen_Profession.name) | ||
.insert("book", "Jan", List("Musician")).transact | ||
|
||
_ <- lit_Book.title.Reviewers.name.Professions.*(gen_Profession.name) | ||
.query.get.map(_ ==> List(("book", "Jan", List("Musician")))) | ||
|
||
// Same as | ||
_ <- lit_Book.title.Reviewers.Professions.*(gen_Profession.name) | ||
.query.get.map(_ ==> List(("book", List("Musician")))) | ||
} yield () | ||
} | ||
|
||
|
||
"Back only" - partition { implicit conn => | ||
for { | ||
_ <- lit_Book.title("A good book").cat("good").Author.name("Marc").save.transact | ||
_ <- lit_Book.title.Author.name._lit_Book.cat | ||
.query.get.map(_ ==> List(("A good book", "Marc", "good"))) | ||
} yield () | ||
} | ||
|
||
|
||
"Adjacent" - partition { implicit conn => | ||
for { | ||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.name | ||
.insert("book", "John", "Marc").transact | ||
|
||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.name | ||
.query.get.map(_ ==> List(("book", "John", "Marc"))) | ||
|
||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.*(gen_Person.name) | ||
.query.get.map(_ ==> List(("book", "John", List("Marc")))) | ||
} yield () | ||
} | ||
|
||
|
||
"Nested" - partition { implicit conn => | ||
for { | ||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.*(gen_Person.name) | ||
.insert("book", "John", List("Marc")).transact | ||
|
||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.name | ||
.query.get.map(_ ==> List(("book", "John", "Marc"))) | ||
|
||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.*(gen_Person.name) | ||
.query.get.map(_ ==> List(("book", "John", List("Marc")))) | ||
} yield () | ||
} | ||
|
||
|
||
"Nested + adjacent" - partition { implicit conn => | ||
for { | ||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.*( | ||
gen_Person.name.Professions.name | ||
).insert("book", "John", List(("Marc", "Musician"))).transact | ||
|
||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.name.Professions.name | ||
.query.get.map(_ ==> List(("book", "John", "Marc", "Musician"))) | ||
|
||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.*(gen_Person.name.Professions.name) | ||
.query.get.map(_ ==> List(("book", "John", List(("Marc", "Musician"))))) | ||
} yield () | ||
} | ||
|
||
|
||
"Nested + nested" - partition { implicit conn => | ||
for { | ||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.*( | ||
gen_Person.name.Professions.*( | ||
gen_Profession.name)) | ||
.insert("book", "John", List(("Marc", List("Musician")))).transact | ||
|
||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.name.Professions.name | ||
.query.get.map(_ ==> List(("book", "John", "Marc", "Musician"))) | ||
|
||
_ <- lit_Book.title.Author.name._lit_Book.Reviewers.*( | ||
gen_Person.name.Professions.*( | ||
gen_Profession.name)) | ||
.query.get.map(_ ==> List(("book", "John", List(("Marc", List("Musician")))))) | ||
} yield () | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...shared/src/test/scala/molecule/datalog/datomic/compliance/partitions/PartitionTests.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,6 @@ | ||
package molecule.datalog.datomic.compliance.partitions | ||
|
||
import molecule.coreTests.spi.partitions.PartitionTests | ||
import molecule.datalog.datomic.setup.TestAsync_datomic | ||
|
||
object PartitionTests extends PartitionTests with TestAsync_datomic |
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
6 changes: 6 additions & 0 deletions
6
...hared/src/test/scala/molecule/document/mongodb/compliance/partitions/PartitionTests.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,6 @@ | ||
package molecule.document.mongodb.compliance.partitions | ||
|
||
import molecule.coreTests.spi.partitions.PartitionTests | ||
import molecule.document.mongodb.setup.TestAsync_mongodb | ||
|
||
object PartitionTests extends PartitionTests with TestAsync_mongodb |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
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
Oops, something went wrong.