Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sqlint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
sqlint
Commits
4e83013c
Commit
4e83013c
authored
9 years ago
by
Kieran Trezona-le Comte
Browse files
Options
Downloads
Patches
Plain Diff
Extra test case, and make existing tests more concise
parent
acd87795
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
spec/sqlint_spec.rb
+10
-6
10 additions, 6 deletions
spec/sqlint_spec.rb
with
10 additions
and
6 deletions
spec/sqlint_spec.rb
+
10
−
6
View file @
4e83013c
...
...
@@ -35,24 +35,28 @@ RSpec.describe SQLint do
context
"with a single invalid keyword"
do
let
(
:input
)
{
"WIBBLE"
}
it
"reports one error"
do
expect
(
results
.
size
).
to
eq
(
1
)
expect
(
results
.
first
).
to
eq
(
error
(
1
,
1
,
WIBBLE_ERROR
))
expect
(
results
).
to
eq
([
error
(
1
,
1
,
WIBBLE_ERROR
)])
end
end
context
"with two successive invalid keywords"
do
let
(
:input
)
{
"WIBBLE WIBBLE"
}
it
"report 2 errors"
do
expect
(
results
).
to
eq
([
error
(
1
,
1
,
WIBBLE_ERROR
)])
end
end
context
"with a single invalid keyword on a later line"
do
let
(
:input
)
{
"SELECT 1;
\n
WIBBLE"
}
it
"reports one error"
do
expect
(
results
.
size
).
to
eq
(
1
)
expect
(
results
.
first
).
to
eq
(
error
(
2
,
1
,
WIBBLE_ERROR
))
expect
(
results
).
to
eq
([
error
(
2
,
1
,
WIBBLE_ERROR
)])
end
end
context
"with a single error part-way through a line"
do
let
(
:input
)
{
"SELECT '"
}
it
"reports one error"
do
expect
(
results
.
size
).
to
eq
(
1
)
expect
(
results
.
first
).
to
eq
(
error
(
1
,
8
,
'unterminated quoted string at or near "\'"'
))
expect
(
results
).
to
eq
([
error
(
1
,
8
,
'unterminated quoted string at or near "\'"'
)])
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment