Skip to content

Commit

Permalink
Fix DLSD snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Jun 9, 2018
1 parent 0eee5f8 commit 23174a3
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,35 +208,33 @@ final class DSLContentAssistTests extends CompletionTestSuite {
@Test
void testAssignedVariable6() {
createDsls '''\
contribute(bind(exprs: assignedVariable(type(BigInteger)))) {
contribute(bind(exprs: assignedVariable())) {
property name: 'var_' + exprs[0].leftExpression.name
}
'''.stripIndent()

String contents = 'def foo = '
ICompletionProposal[] proposals = createProposalsAtOffset(contents, getIndexOf(contents, 'foo = '))
proposalExists(proposals, 'var_foo', 1)
checkUniqueProposal(contents, '= ', 'var_foo')
}

@Test
@Test // https://github.com/groovy/groovy-eclipse/issues/598
void testAssignedVariable7() {
createDsls '''\
contribute(bind(exprs: assignedVariable(type(BigInteger)))) {
contribute(bind(exprs: assignedVariable())) {
property name: 'var_' + exprs[0].leftExpression.name
}
'''.stripIndent()

String contents = '''\
def foo = { }
'''.stripIndent()
ICompletionProposal[] proposals = createProposalsAtOffset(contents, getIndexOf(contents, 'foo = {'))
proposalExists(proposals, 'var_foo', 1)
checkUniqueProposal(contents, '{ ', 'var_foo')
}

@Test
void testAssignedVariable8() {
createDsls '''\
contribute(bind(exprs: assignedVariable(type(BigInteger)))) {
contribute(bind(exprs: assignedVariable())) {
property name: 'var_' + exprs[0].leftExpression.name
}
'''.stripIndent()
Expand All @@ -249,8 +247,7 @@ final class DSLContentAssistTests extends CompletionTestSuite {
}
}
'''.stripIndent()
ICompletionProposal[] proposals = createProposalsAtOffset(contents, getIndexOf(contents, 'baz {'))
proposalExists(proposals, 'var_foo', 1)
checkUniqueProposal(contents, 'baz {', 'var_foo')
}

@Test
Expand Down

0 comments on commit 23174a3

Please sign in to comment.