assertFalse(c.next());
assertEquals("1. line1aaa", c.get());
}
public void testScriptConsole() throws Exception {
ScriptConsoleHistory c = new ScriptConsoleHistory();
assertFalse(c.prev());
assertFalse(c.next());
c.update("test");
assertEquals("test", c.get());
assertFalse(c.prev());
assertEquals("test", c.get());
assertFalse(c.next());
assertEquals("test", c.get());
c.commit();
assertEquals("", c.get());
assertTrue(c.prev());
assertEquals("test", c.get());
assertFalse(c.prev());
assertEquals("test", c.get());
assertFalse(c.next()); //the 'current' buffer doesn't enter the history
assertEquals("test", c.get());
assertFalse(c.prev());
assertEquals("test", c.get());
c.update("kkk");
c.commit();
assertEquals("test\nkkk\n", c.getAsDoc().get());
assertFalse(c.next());
assertEquals("", c.get());
assertTrue(c.prev());
assertEquals("kkk", c.get());
assertTrue(c.prev());
assertEquals("test", c.get());
c.update("");
c.commit();
assertEquals("test\nkkk\n\n", c.getAsDoc().get());
assertTrue(c.prev());
assertEquals("kkk", c.get());
}