Skip to content

Commit

Permalink
Fix small newline issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bugarela committed Oct 28, 2024
1 parent 39f989e commit b887590
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion quint/cli-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,13 @@ Regression test for [#1108](https://github.com/informalsystems/quint/issues/1108
quint parse testFixture/_1052one.qnt

### OK on typecheck SuperSpec via Unix hashbang

See [#1500](https://github.com/informalsystems/quint/issues/1500).

<!-- !test exit 0 -->
<!-- !test check typecheck SuperSpec via Unix hashbang -->
```
if [ `uname -s` == 'Linux' -o `uname -s` == 'Darwin' ]; then
./testFixture/SuperSpec.qnt
fi
```
```
1 change: 1 addition & 0 deletions quint/src/generated/Quint.g4
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ grammar Quint;
import { quintErrorToString } from '../quintError'

}

// entry point for the parser
modules : HASHBANG_LINE? module+ EOF;

Expand Down
3 changes: 3 additions & 0 deletions quint/test/parsing/quintParserFrontend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ describe('syntax errors', () => {
assert.equal(errors[0].message, `token recognition error at: '~'`)
assert.equal(errors[0].code, 'QNT000')
})

it('error on unexpected hash', () => {
// # is an unexpected token
const code = 'module unexpectedToken { def access(p) = { p # name } }'
Expand All @@ -185,6 +186,7 @@ describe('syntax errors', () => {
assert.equal(errors[0].message, `token recognition error at: '# '`)
assert.equal(errors[0].code, 'QNT000')
})

it('error on unexpected hashbang', () => {
// hashbang '#!' is only valid at the beginning of a file
const code = 'module unexpectedToken { def access(p) = { p #! name } }'
Expand All @@ -193,6 +195,7 @@ describe('syntax errors', () => {
assert.equal(errors[0].message, `token recognition error at: '#! name } }'`)
assert.equal(errors[0].code, 'QNT000')
})

it('error on multiple hashbangs', () => {
// only a single hashbang '#!' is valid at the beginning of a file
const code = '#!foo\n#!bar\nmodule unexpectedToken { def access = { true } }'
Expand Down
2 changes: 1 addition & 1 deletion quint/testFixture/SuperSpec.qnt
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,4 @@ module withConsts {

// create an instance of Proto by using '*'
// import Proto(*) as Inst2
}
}

0 comments on commit b887590

Please sign in to comment.