Mercurial > hg4j
diff test/org/tmatesoft/hg/test/OutputParser.java @ 479:59b7c817bc4d
Methods from Main graduated as tests
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 12 Jul 2012 20:02:49 +0200 |
parents | e74580e24feb |
children | ab21ac7dd833 |
line wrap: on
line diff
--- a/test/org/tmatesoft/hg/test/OutputParser.java Thu Jul 12 19:11:12 2012 +0200 +++ b/test/org/tmatesoft/hg/test/OutputParser.java Thu Jul 12 20:02:49 2012 +0200 @@ -52,10 +52,10 @@ } public Iterable<String> lines() { - return lines("(.+)$"); + return lines(Pattern.compile("(.+)$", Pattern.MULTILINE), 1); } - public Iterable<String> lines(String pattern) { - final Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(result); + public Iterable<String> lines(Pattern pattern, final int group) { + final Matcher m = pattern.matcher(result); class S implements Iterable<String>, Iterator<String> { public Iterator<String> iterator() { return this; @@ -71,7 +71,7 @@ public String next() { if (next) { - String rv = m.group(1); + String rv = m.group(group); next = m.find(); return rv; }