Skip to content

Commit

Permalink
OPA conformance: Pass refheads test suite (microsoft#90)
Browse files Browse the repository at this point in the history
- parser: allow non-string index at any position; not just last
- impl Default for Context
- Fix width of OPA test results table
- Allow non string compoenent anywhere in rule ref; not just as last item.
- Normalize want_result before comparison.
- Ensure that object rules are created even if no definition succeed,
- Sort want_result values for "refheads/general, multiple result-set entries"
  The entries are in reverse order of how OPA and regorus produce.
- Emit PASS status for each OPA testpoint
- Detect rule conflicts

Signed-off-by: Anand Krishnamoorthi <[email protected]>
  • Loading branch information
anakrish authored Jan 5, 2024
1 parent 25dec7e commit 3e1ddac
Show file tree
Hide file tree
Showing 5 changed files with 314 additions and 100 deletions.
8 changes: 8 additions & 0 deletions src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,14 @@ pub enum Rule {
},
}

impl Rule {
pub fn span(&self) -> &Span {
match self {
Self::Spec { span, .. } | Self::Default { span, .. } => span,
}
}
}

#[derive(Debug)]
pub struct Package {
pub span: Span,
Expand Down
Loading

0 comments on commit 3e1ddac

Please sign in to comment.