use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteClassNameExpressionTest method autocompleteToClassWithoutPackage.
@Test
public void autocompleteToClassWithoutPackage() throws Exception {
String code = "Integer f = new Integ";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches().size()).isGreaterThan(0);
assertThat(autocomplete.getMatches()).contains("Integer");
assertThat(autocomplete.getStartIndex()).isEqualTo(code.length() - 5);
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class GroovyEvaluatorAutocompleteClassNameExpressionTest method autocompleteCreateNewIntegerWithPackage.
@Test
public void autocompleteCreateNewIntegerWithPackage() throws Exception {
String code = "new java.lang.Inte";
// when
AutocompleteResult autocomplete = groovyEvaluator.autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(code.length() - 4);
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class GroovyEvaluatorAutocompleteClassNameExpressionTest method autocompleteToIntegerClassWithPackage.
@Test
public void autocompleteToIntegerClassWithPackage() throws Exception {
String code = "def f = new java.lang.Inte";
// when
AutocompleteResult autocomplete = groovyEvaluator.autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(code.length() - 4);
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class GroovyEvaluatorAutocompleteTest method defaultImportsAutocompleteToRED.
@Test
public void defaultImportsAutocompleteToRED() throws Exception {
String code = "def colors = [ Color.RE";
// when
AutocompleteResult autocomplete = groovyEvaluator.autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(code.length() - 2);
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class GroovyEvaluatorAutocompleteTest method autocompleteMatchesToRED.
@Test
public void autocompleteMatchesToRED() throws Exception {
String code = "Color.R";
// when
AutocompleteResult autocomplete = groovyEvaluator.autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(code.length() - 1);
}
Aggregations