caddyfile: Improve Dispenser.NextBlock() to support nesting

This commit is contained in:
Matthew Holt 2019-09-10 19:21:52 -06:00
parent 0cf592fa2e
commit 2459c292a4
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
14 changed files with 95 additions and 58 deletions

View file

@ -148,7 +148,7 @@ func TestDispenser_NextBlock(t *testing.T) {
d := newTestDispenser(input)
assertNextBlock := func(shouldLoad bool, expectedCursor, expectedNesting int) {
if loaded := d.NextBlock(); loaded != shouldLoad {
if loaded := d.NextBlock(0); loaded != shouldLoad {
t.Errorf("NextBlock(): Should return %v but got %v", shouldLoad, loaded)
}
if d.cursor != expectedCursor {