Skip to content

Commit

Permalink
fixed #265
Browse files Browse the repository at this point in the history
  • Loading branch information
iwarapter committed May 20, 2016
1 parent f21615c commit 3a4589e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void init() {

@Override
public void visitNode(AstNode node) {
if ("include".equals(node.getTokenValue()) && !node.getFirstChild(PuppetGrammar.FUNCVALUES).getChildren(PuppetPunctuator.COMMA).isEmpty()) {
if ("include".equals(node.getTokenValue()) && node.hasDescendant(PuppetPunctuator.COMMA)) {
addIssue(node, this, "Split this include statement into multiple lines.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class OneIncludePerLineCheckSpec extends Specification {
.next().atLine(2).withMessage(MESSAGE)
.next().atLine(3).withMessage(MESSAGE)
.next().atLine(6).withMessage(MESSAGE)
.next().atLine(8).withMessage(MESSAGE)
.noMore();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ class FunctionSpec extends GrammarSpec {
assertThat(p).matches('include $my_classes')
}
def 'include with brackets'() {
expect:
assertThat(p).matches('include( "stdlib", "apache" )')
}
def "function using hash array accessor"() {
expect:
assertThat(p).matches('dirname($logfiles[1][1])')
}
}
}

0 comments on commit 3a4589e

Please sign in to comment.