module = createModule(project, "xyz.erl", text);
final ScannerService scanner = module.getScanner();
try {
module.open(null);
final ErlToken token = scanner.getTokenAt(-1);
assertNull(token);
final ErlToken token2 = scanner.getTokenAt(0);
assertNotNull(token2);
assertEquals(ErlToken.KIND_OTHER, token2.getKind());
final ErlToken token3 = scanner.getTokenAt(1);
assertNotNull(token3);
assertEquals(ErlToken.KIND_ATOM, token3.getKind());
final ErlToken token4 = scanner.getTokenAt(12);
assertNotNull(token4);
assertEquals(ErlToken.KIND_OTHER, token4.getKind());
final ErlToken token5 = scanner.getTokenAt(24);
assertNotNull(token5);
assertEquals(ErlToken.KIND_STRING, token5.getKind());
final ErlToken token6 = scanner.getTokenAt(text.length() - 1);
assertNotNull(token6);
assertEquals(ErlToken.KIND_OTHER, token6.getKind());
final ErlToken token7 = scanner.getTokenAt(text.length());
assertNull(token7);
} finally {
scanner.dispose();
}
}