@Test public void one_line_headline1__has_one_result_with_deep_1() { List<AsciiDoctorHeadline> result = parserToTest.parse("= headline1"); assertHeadlines(result).hasHeadlines(1).hasHeadline("headline1").withDeep(1); }
public List<AsciiDoctorHeadline> parse(String asciidoctorScript) { List<AsciiDoctorHeadline> list = new ArrayList<AsciiDoctorHeadline>(); if (asciidoctorScript == null) { return list; } StringBuilder current = new StringBuilder(); int start=0; int currentPos = -1; for (char c : asciidoctorScript.toCharArray()) { currentPos++; if (c == '\n') { int end = currentPos-1; addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, end); current = new StringBuilder(); start =currentPos+1; continue; } if (current != null) { current.append(c); if (current.charAt(0) != '=') { current = null; } } } addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, currentPos); return list; }
SimpleHeadlineParser { public List<AsciiDoctorHeadline> parse(String asciidoctorScript) { List<AsciiDoctorHeadline> list = new ArrayList<AsciiDoctorHeadline>(); if (asciidoctorScript == null) { return list; } StringBuilder current = new StringBuilder(); int start=0; int currentPos = -1; for (char c : asciidoctorScript.toCharArray()) { currentPos++; if (c == '\n') { int end = currentPos-1; addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, end); current = new StringBuilder(); start =currentPos+1; continue; } if (current != null) { current.append(c); if (current.charAt(0) != '=') { current = null; } } } addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, currentPos); return list; } }
SimpleHeadlineParser { public List<AsciiDoctorHeadline> parse(String asciidoctorScript) { List<AsciiDoctorHeadline> list = new ArrayList<AsciiDoctorHeadline>(); if (asciidoctorScript == null) { return list; } StringBuilder current = new StringBuilder(); int start=0; int currentPos = -1; for (char c : asciidoctorScript.toCharArray()) { currentPos++; if (c == '\n') { int end = currentPos-1; addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, end); current = new StringBuilder(); start =currentPos+1; continue; } if (current != null) { current.append(c); if (current.charAt(0) != '=') { current = null; } } } addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, currentPos); return list; }  }
SimpleHeadlineParser { public List<AsciiDoctorHeadline> parse(String asciidoctorScript) { List<AsciiDoctorHeadline> list = new ArrayList<AsciiDoctorHeadline>(); if (asciidoctorScript == null) { return list; } StringBuilder current = new StringBuilder(); int start=0; int currentPos = -1; for (char c : asciidoctorScript.toCharArray()) { currentPos++; if (c == '\n') { int end = currentPos-1; addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, end); current = new StringBuilder(); start =currentPos+1; continue; } if (current != null) { current.append(c); if (current.charAt(0) != '=') { current = null; } } } addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, currentPos); return list; }  List<AsciiDoctorHeadline> parse(String asciidoctorScript); }
SimpleHeadlineParser { public List<AsciiDoctorHeadline> parse(String asciidoctorScript) { List<AsciiDoctorHeadline> list = new ArrayList<AsciiDoctorHeadline>(); if (asciidoctorScript == null) { return list; } StringBuilder current = new StringBuilder(); int start=0; int currentPos = -1; for (char c : asciidoctorScript.toCharArray()) { currentPos++; if (c == '\n') { int end = currentPos-1; addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, end); current = new StringBuilder(); start =currentPos+1; continue; } if (current != null) { current.append(c); if (current.charAt(0) != '=') { current = null; } } } addHeadlineWhenCurrentNotEmptyAndHasASpaceAfterLastEqual(asciidoctorScript, list, current, start, currentPos); return list; }  List<AsciiDoctorHeadline> parse(String asciidoctorScript);  }