Skip to content
Snippets Groups Projects
Commit 43ed59a7 authored by npedot's avatar npedot
Browse files

adds test algo schema closure

parent 016ed25b
Branches
Tags
No related merge requests found
......@@ -119,9 +119,9 @@ class Schema () {
return keys
}
fun closure(attrs: Set<Column>,fds:Set<Constraint>): Set<Column> {
fun closure(attrs: Set<Column>, fds:Set<Constraint>): Set<Column> {
val result = HashSet<Column>(attrs)
//println("RESULT = $result")
//println("RESULT X = $result")
var found = true
while(found) {
found= false
......
......@@ -40,4 +40,13 @@ class ConstraintTest {
keys.toString()
)
}
@Test
fun test_closure() {
val columns = Column.set("C,S")
val constraints = Constraint.set("C-->T;H,R-->C;H,T-->R;C,S-->G;H,S-->R")
val closure = Schema.closure(columns, constraints)
println(closure)
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment