Files
regorus/tests/lexer/cases/eof.yaml
Anand Krishnamoorthi cb0b3a1790 Code from github.com/anakrish/rego-rs
Authored by anakrish and mingweishih

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-02-09 10:56:54 -08:00

36 lines
791 B
YAML

# Copyright (c) Rego-Rs Authors.
# Licensed under the Apache 2.0 license.
cases:
# All other yamls lock down eof.
# Specific eof tests:
# Empty file.
- note: empty-file
rego:
tokens: [""]
kinds: [Eof]
# File with comments.
- note: only-comments
rego: |
# This is a comment.
# This is another comment.
tokens: [""]
kinds: [Eof]
# File with eof and trailing chars.
# Trailing chars are ignored.
- note: eof-trailing-chars
rego: "true (\x0000false + hello"
tokens: ["true", "(", ""]
kinds: [Ident, Symbol, Eof]
# Empty string must be distinguishable from Eof eventhough
# both result in an empty string as the span.
- note: empty-string-eof
rego: "\"\""
tokens: ["", ""]
kinds: [String, Eof]