Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
/SRL-JavaPublic archive

Commit1932647

Browse files
committed
Add some unit test fort method begin with
1 parentc175ac4 commit1932647

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

‎src/test/java/TestBeginWith.java‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
importcom.github.simpleregex.SRLCompiler;
2+
importjunit.framework.TestCase;
3+
4+
/**
5+
* Created by marco on 07/09/16.
6+
*/
7+
publicclassTestBeginWithextendsTestCase {
8+
9+
10+
/**
11+
* Test method begin with that accept one digit
12+
*/
13+
publicvoidtestBeginWithDigit(){
14+
SRLCompilercompiler =newSRLCompiler("begin with digit");
15+
compiler.parse();
16+
assertEquals("/^[0-9]/",compiler.generate());
17+
}
18+
19+
/**
20+
* Test method begin with that accept one character
21+
*/
22+
publicvoidtestBeginWithLetter(){
23+
SRLCompilercompiler =newSRLCompiler("begin with letter");
24+
compiler.parse();
25+
assertEquals("/^[a-z]/",compiler.generate());
26+
}
27+
28+
/**
29+
* Test method begin with that accept one of the character between quotes
30+
*/
31+
publicvoidtestBeginWithSpecificCharacters(){
32+
SRLCompilercompiler =newSRLCompiler("begin with '._%+-'");
33+
compiler.parse();
34+
assertEquals("/^[._%+-]/",compiler.generate());
35+
}
36+
37+
38+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp