Examples of CodeChunk


Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void testPropertiesCodeTag() throws Exception {
    String options = "properties";
    String content = "blablah blah\n" + "#algum comentario\n" + "texto=valor\n" + "texto:valor\n" + "texto valor";
    CodeChunk chunk = new CodeChunk(content, options);
    String output = getContent(chunk);

    assertPygmentsRan(output);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void testPropertiesCodeTagWithEscapes() throws Exception {
    String options = "properties abc";
    String string = "blablah blah\n" + "#algum comentario\n" + "texto\\=valor=valor\n" + "texto\\:valor:valor\n"
        + "texto\\ valor valor\n" + "a b\\#fake comentario";
    CodeChunk chunk = new CodeChunk(string, options);
    String output = getContent(chunk);

    assertPygmentsRan(output);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void languageCodeTagShouldInsertLineNumbersWhenOptionContainsSharp() {
    String string = "public static void main(String[] args) {";
    String options = "java #";
    CodeChunk chunk = new CodeChunk(string, options);
    String output = getContent(chunk);

    assertPygmentsRan(output);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void languageCodeTagShouldUnderstandLineNumbersEvenWhenNoLanguageIsSelected() {
    String string = "def some: \"bizarre code\" in: unknownLanguage";
    String options = "#";
    CodeChunk chunk = new CodeChunk(string, options);
    String output = getContent(chunk);

    assertPygmentsRan(output);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void languageCodeTagShouldUnderstandLineNumbersAndHighlightsWhenNoLanguageIsSelected() {
    String string = "def some: \"bizarre code\" \nin: unknownLanguage";
    String options = "# h=1,2";
    CodeChunk chunk = new CodeChunk(string, options);
    String output = getContent(chunk);

    assertPygmentsRan(output);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void languageCodeTagShouldUnderstandLineNumbersAndCSharpLanguage() {
    String string = "public class SomeClass {";
    String options = "c# #";
    CodeChunk chunk = new CodeChunk(string, options);
    String output = getContent(chunk);

    assertPygmentsRan(output);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void codeTagWithReferenceWithoutLanguage() throws Exception {
    String options = "label=javacode1";
    String code = publicStaticVoidMain();
    CodeChunk chunk = new CodeChunk(code, options);
    String output = getContent(chunk);

    assertTrue(output.startsWith("\\tubainaCodeLabel{javacode1}"));
    assertPygmentsRan(output);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void codeTagWithReferenceWithLanguage() throws Exception {
    String options = "java label=javacode1";
    String code = publicStaticVoidMain();
    CodeChunk chunk = new CodeChunk(code, options);
    String output = getContent(chunk);


    assertTrue(output.startsWith("\\tubainaCodeLabel{javacode1}"));
    assertPygmentsRan(output);
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void codeTagWithFileNameWithoutLanguage() throws Exception {
    String options = "filename=src/Main.java";
    String code = publicStaticVoidMain();
    CodeChunk chunk = new CodeChunk(code, options);
    String output = getContent(chunk);

    assertTrue(output.startsWith("\\tubainaCodeFileName{src/Main.java}\n"));
    assertPygmentsRan(output);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.chunk.CodeChunk

  @Test
  public void codeTagWithFileNameWithLanguage() throws Exception {
    String options = "java filename=src/Main.java";
    String code = publicStaticVoidMain();
    CodeChunk chunk = new CodeChunk(code, options);
    String output = getContent(chunk);

    assertTrue(output.startsWith("\\tubainaCodeFileName{src/Main.java}\n"));
    assertPygmentsRan(output);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.