Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat15 committed Oct 28, 2024
1 parent b83dc23 commit 03139e3
Show file tree
Hide file tree
Showing 12 changed files with 484 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .path.definition.user import user, persona

definition resource {
relation user: user
relation persona: persona
permission view = user + persona
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
NodeTypeFile
end-rune = 20
input-source = local imports with keyword in import path test
start-rune = 0
child-node =>
NodeTypeImport
end-rune = 10
input-source = local imports with keyword in import path test
start-rune = 0
child-node =>
NodeTypeError
end-rune = 10
error-message = Expected keyword import, found token TokenTypeKeyword
error-source = definition
input-source = local imports with keyword in import path test
start-rune = 11
path-segment =>
NodeTypeIdentifier
end-rune = 9
identifier-value = path
input-source = local imports with keyword in import path test
start-rune = 6
NodeTypeIdentifier
end-rune = 10
input-source = local imports with keyword in import path test
start-rune = 11
child-node =>
NodeTypeError
end-rune = 10
error-message = Expected identifier, found token TokenTypeKeyword
error-source = definition
input-source = local imports with keyword in import path test
start-rune = 11
NodeTypeDefinition
end-rune = 20
input-source = local imports with keyword in import path test
start-rune = 11
child-node =>
NodeTypeError
end-rune = 20
error-message = Expected identifier, found token TokenTypePeriod
error-source = .
input-source = local imports with keyword in import path test
start-rune = 21
NodeTypeError
end-rune = 20
error-message = Unexpected token at root level: TokenTypePeriod
error-source = .
input-source = local imports with keyword in import path test
start-rune = 21
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .path.to.user import user, caveat

definition resource {
relation user: user
relation persona: persona
permission view = user + persona
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
NodeTypeFile
end-rune = 154
input-source = local imports with keyword in identifiers test
start-rune = 0
child-node =>
NodeTypeImport
end-rune = 30
input-source = local imports with keyword in identifiers test
start-rune = 0
child-node =>
NodeTypeError
end-rune = 30
error-message = Expected one of: [TokenTypeComma], found: TokenTypeKeyword
error-source = caveat
input-source = local imports with keyword in identifiers test
start-rune = 32
imported-definition =>
NodeTypeIdentifier
end-rune = 29
identifier-value = user
input-source = local imports with keyword in identifiers test
start-rune = 26
NodeTypeIdentifier
end-rune = 30
input-source = local imports with keyword in identifiers test
start-rune = 32
child-node =>
NodeTypeError
end-rune = 30
error-message = Expected identifier, found token TokenTypeKeyword
error-source = caveat
input-source = local imports with keyword in identifiers test
start-rune = 32
path-segment =>
NodeTypeIdentifier
end-rune = 9
identifier-value = path
input-source = local imports with keyword in identifiers test
start-rune = 6
NodeTypeIdentifier
end-rune = 12
identifier-value = to
input-source = local imports with keyword in identifiers test
start-rune = 11
NodeTypeIdentifier
end-rune = 17
identifier-value = user
input-source = local imports with keyword in identifiers test
start-rune = 14
NodeTypeCaveatDefinition
end-rune = 37
input-source = local imports with keyword in identifiers test
start-rune = 32
child-node =>
NodeTypeError
end-rune = 37
error-message = Expected identifier, found token TokenTypeSyntheticSemicolon
error-source =

input-source = local imports with keyword in identifiers test
start-rune = 38
NodeTypeDefinition
definition-name = resource
end-rune = 153
input-source = local imports with keyword in identifiers test
start-rune = 40
child-node =>
NodeTypeRelation
end-rune = 84
input-source = local imports with keyword in identifiers test
relation-name = user
start-rune = 66
allowed-types =>
NodeTypeTypeReference
end-rune = 84
input-source = local imports with keyword in identifiers test
start-rune = 81
type-ref-type =>
NodeTypeSpecificTypeReference
end-rune = 84
input-source = local imports with keyword in identifiers test
start-rune = 81
type-name = user
NodeTypeRelation
end-rune = 114
input-source = local imports with keyword in identifiers test
relation-name = persona
start-rune = 90
allowed-types =>
NodeTypeTypeReference
end-rune = 114
input-source = local imports with keyword in identifiers test
start-rune = 108
type-ref-type =>
NodeTypeSpecificTypeReference
end-rune = 114
input-source = local imports with keyword in identifiers test
start-rune = 108
type-name = persona
NodeTypePermission
end-rune = 151
input-source = local imports with keyword in identifiers test
relation-name = view
start-rune = 120
compute-expression =>
NodeTypeUnionExpression
end-rune = 151
input-source = local imports with keyword in identifiers test
start-rune = 138
left-expr =>
NodeTypeIdentifier
end-rune = 141
identifier-value = user
input-source = local imports with keyword in identifiers test
start-rune = 138
right-expr =>
NodeTypeIdentifier
end-rune = 151
identifier-value = persona
input-source = local imports with keyword in identifiers test
start-rune = 145
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .path.to.user import user,

definition resource {
relation user: user
relation persona: persona
permission view = user + persona
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
NodeTypeFile
end-rune = 147
input-source = local imports with malformed identifiers set test
start-rune = 0
child-node =>
NodeTypeImport
end-rune = 30
input-source = local imports with malformed identifiers set test
start-rune = 0
child-node =>
NodeTypeError
end-rune = 30
error-message = Expected one of: [TokenTypeComma], found: TokenTypeKeyword
error-source = definition
input-source = local imports with malformed identifiers set test
start-rune = 33
imported-definition =>
NodeTypeIdentifier
end-rune = 29
identifier-value = user
input-source = local imports with malformed identifiers set test
start-rune = 26
NodeTypeIdentifier
end-rune = 30
input-source = local imports with malformed identifiers set test
start-rune = 33
child-node =>
NodeTypeError
end-rune = 30
error-message = Expected identifier, found token TokenTypeKeyword
error-source = definition
input-source = local imports with malformed identifiers set test
start-rune = 33
path-segment =>
NodeTypeIdentifier
end-rune = 9
identifier-value = path
input-source = local imports with malformed identifiers set test
start-rune = 6
NodeTypeIdentifier
end-rune = 12
identifier-value = to
input-source = local imports with malformed identifiers set test
start-rune = 11
NodeTypeIdentifier
end-rune = 17
identifier-value = user
input-source = local imports with malformed identifiers set test
start-rune = 14
NodeTypeDefinition
definition-name = resource
end-rune = 146
input-source = local imports with malformed identifiers set test
start-rune = 33
child-node =>
NodeTypeRelation
end-rune = 77
input-source = local imports with malformed identifiers set test
relation-name = user
start-rune = 59
allowed-types =>
NodeTypeTypeReference
end-rune = 77
input-source = local imports with malformed identifiers set test
start-rune = 74
type-ref-type =>
NodeTypeSpecificTypeReference
end-rune = 77
input-source = local imports with malformed identifiers set test
start-rune = 74
type-name = user
NodeTypeRelation
end-rune = 107
input-source = local imports with malformed identifiers set test
relation-name = persona
start-rune = 83
allowed-types =>
NodeTypeTypeReference
end-rune = 107
input-source = local imports with malformed identifiers set test
start-rune = 101
type-ref-type =>
NodeTypeSpecificTypeReference
end-rune = 107
input-source = local imports with malformed identifiers set test
start-rune = 101
type-name = persona
NodeTypePermission
end-rune = 144
input-source = local imports with malformed identifiers set test
relation-name = view
start-rune = 113
compute-expression =>
NodeTypeUnionExpression
end-rune = 144
input-source = local imports with malformed identifiers set test
start-rune = 131
left-expr =>
NodeTypeIdentifier
end-rune = 134
identifier-value = user
input-source = local imports with malformed identifiers set test
start-rune = 131
right-expr =>
NodeTypeIdentifier
end-rune = 144
identifier-value = persona
input-source = local imports with malformed identifiers set test
start-rune = 138
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .path.to. import user, persona

definition resource {
relation user: user
relation persona: persona
permission view = user + persona
}
Loading

0 comments on commit 03139e3

Please sign in to comment.