use of org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent in project mylyn.docs by eclipse.
the class CharactersEventTest method equals.
@Test
public void equals() {
assertEquality(new CharactersEvent("test it"), new CharactersEvent("test it"));
assertInequality(new CharactersEvent("test it"), new CharactersEvent("test it again"));
}
use of org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent in project mylyn.docs by eclipse.
the class SourceBlocksTest method process.
@Test
public void process() {
EventDocumentBuilder builder = new EventDocumentBuilder();
sourceBlocks.process(ProcessingContext.builder().build(), builder, LineSequence.create("one\nb2\nmore\n\nb1 and\n\n\nb2"));
ImmutableList<DocumentBuilderEvent> expectedEvents = //
ImmutableList.of(//
new BeginBlockEvent(BlockType.PARAGRAPH, new Attributes()), //
new CharactersEvent("b2"), //
new CharactersEvent("more"), //
new EndBlockEvent(), //
new BeginBlockEvent(BlockType.QUOTE, new Attributes()), //
new CharactersEvent("b1 and"), //
new EndBlockEvent(), //
new BeginBlockEvent(BlockType.PARAGRAPH, new Attributes()), //
new CharactersEvent("b2"), new EndBlockEvent());
assertEquals(Joiner.on("\n").join(builder.getDocumentBuilderEvents().getEvents()), expectedEvents, builder.getDocumentBuilderEvents().getEvents());
}
use of org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent in project mylyn.docs by eclipse.
the class EventDocumentBuilderTest method characters.
@Test
public void characters() {
builder.characters("test 123");
assertEvents(new CharactersEvent("test 123"));
}
use of org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent in project mylyn.docs by eclipse.
the class FontElementStrategyTest method spanStrategyBuildsNonHtml.
@Test
public void spanStrategyBuildsNonHtml() {
EventDocumentBuilder builder = new EventDocumentBuilder();
SpanStrategy spanStrategy = strategy.spanStrategy();
spanStrategy.beginSpan(builder, SpanType.SPAN, new Attributes(null, null, "color: red", null));
builder.characters("test");
spanStrategy.endSpan(builder);
assertEquals(Arrays.asList(new BeginSpanEvent(SpanType.SPAN, new Attributes(null, null, "color: red", null)), new CharactersEvent("test"), new EndSpanEvent()), builder.getDocumentBuilderEvents().getEvents());
}
use of org.eclipse.mylyn.wikitext.parser.builder.event.CharactersEvent in project mylyn.docs by eclipse.
the class MultiplexingDocumentBuilderTest method characters.
@Test
public void characters() {
multiplexer.characters("test 123");
assertEvents(new CharactersEvent("test 123"));
}
Aggregations