use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method shouldReturnResultEqualToParamDouble.
@Ignore
@Test
public void shouldReturnResultEqualToParamDouble() throws Exception {
String code = "double paramDouble = 10.0;\n" + "System.out.println( par";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches().get(0)).isEqualToIgnoringCase("paramDouble");
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method autocompleteMatchesForColorAfterDot.
@Test
public void autocompleteMatchesForColorAfterDot() throws Exception {
String code = "Color.";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(code.length());
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method shouldReturnResultEqualToPackage.
@Test
public void shouldReturnResultEqualToPackage() throws Exception {
String code = "pack";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(0);
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method shouldReturnPrintlnForSecondLine.
@Ignore
@Test
public void shouldReturnPrintlnForSecondLine() throws Exception {
// when
AutocompleteResult autocomplete = evaluator().autocomplete("System.out.printl\n" + "System.out.print\n" + "System.out.prin\n" + "System.out.pri\n", 34);
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(29);
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method shouldReturnPrintlnForFirstLine.
@Ignore
@Test
public void shouldReturnPrintlnForFirstLine() throws Exception {
// when
AutocompleteResult autocomplete = evaluator().autocomplete("System.out.printl\n" + "System.out.print\n" + "System.out.prin\n" + "System.out.pri\n", 17);
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(11);
}
Aggregations