Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
0dba8d40
Commit
0dba8d40
authored
May 07, 2015
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NextBlock() doesn't enter an empty block
parent
2ce51024
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
config/parse/dispenser.go
config/parse/dispenser.go
+4
-0
config/parse/dispenser_test.go
config/parse/dispenser_test.go
+2
-3
No files found.
config/parse/dispenser.go
View file @
0dba8d40
...
...
@@ -109,6 +109,10 @@ func (d *Dispenser) NextBlock() bool {
return
false
}
d
.
Next
()
if
d
.
Val
()
==
"}"
{
// Open and then closed right away
return
false
}
d
.
nesting
++
return
true
}
...
...
config/parse/dispenser_test.go
View file @
0dba8d40
...
...
@@ -150,8 +150,7 @@ func TestDispenser_NextBlock(t *testing.T) {
assertNextBlock
(
true
,
4
,
1
)
assertNextBlock
(
false
,
5
,
0
)
d
.
Next
()
// foobar2
assertNextBlock
(
true
,
8
,
1
)
assertNextBlock
(
false
,
8
,
0
)
assertNextBlock
(
false
,
8
,
0
)
// empty block is as if it didn't exist
}
func
TestDispenser_Args
(
t
*
testing
.
T
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment