Created
December 16, 2011 08:03
-
-
Save masahitojp/1485039 to your computer and use it in GitHub Desktop.
play! でのPattern Matchの使い方
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static play.libs.F.Matcher.*; | |
public class matcher_Test extends UnitTest { | |
@Test | |
public void test_matcher_object() { | |
String value = "Foobar"; | |
for (String s : String.and(StartsWith("Foo")).match(value)) { | |
value = s.toUpperCase(); | |
} | |
assertThat(value, is("FOOBAR")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment