use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method shouldReturnResultEqualToParamArray.
@Ignore
@Test
public void shouldReturnResultEqualToParamArray() throws Exception {
String code = "int[] paramArray = new int[]{1, 3, 5};\n" + "System.out.println(paramA";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches().get(0)).isEqualToIgnoringCase("paramArray");
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method shouldReturnImplements.
@Test
public void shouldReturnImplements() throws Exception {
String code = "class Coordinates implemen";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches().get(0)).isEqualTo("implements");
assertThat(autocomplete.getStartIndex()).isEqualTo(code.length() - 8);
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method shouldReturnResultEqualToParamMap.
@Ignore
@Test
public void shouldReturnResultEqualToParamMap() throws Exception {
String code = "Map<String,Integer> paramMap = new HashMap<>();\n" + "System.out.println( par";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches().get(0)).isEqualToIgnoringCase("paramMap");
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method shouldReturnResultEqualToParamInt.
@Ignore
@Test
public void shouldReturnResultEqualToParamInt() throws Exception {
String code = "int paramInt = 10;\n" + "System.out.println( par";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches().get(0)).isEqualToIgnoringCase("paramInt");
}
use of com.twosigma.beakerx.autocomplete.AutocompleteResult in project beakerx by twosigma.
the class JavaEvaluatorAutocompleteTest method autocompleteToJavaPackage.
@Test
public void autocompleteToJavaPackage() throws Exception {
String code = "jav";
// when
AutocompleteResult autocomplete = evaluator().autocomplete(code, code.length());
// then
assertThat(autocomplete.getMatches()).isNotEmpty();
assertThat(autocomplete.getStartIndex()).isEqualTo(0);
}
Aggregations