Skip to content

Commit

Permalink
test: add regex tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dlg1206 committed Mar 28, 2024
1 parent 8d43a92 commit c71a440
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 10,335 deletions.
9 changes: 5 additions & 4 deletions src/main/java/com/uh/rainbow/util/filter/RegexFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
*
* @author Derek Garcia
*/
class RegexFilter {
public class RegexFilter {

/**
* Build for Regex Filter
*/
public static class Builder {
private final String ACCEPT_ALL = "[\\w\\W]";
private final String REJECT_ALL = "[^\\w\\W]";
private final static String ACCEPT_ALL = "[\\w\\W]";
private final static String REJECT_ALL = "[^\\w\\W]";
private final List<String> accept = new ArrayList<>();
private final List<String> reject = new ArrayList<>();

Expand All @@ -29,12 +29,13 @@ public static class Builder {
*
* @param string String to add. Strings starting with '!' will be rejected, all else is accepted
*/
public void addString(String string) {
public Builder addString(String string) {
if (string.charAt(0) != '!') {
this.accept.add(string);
} else {
this.reject.add(string.substring(1)); // strip leading '!'
}
return this;
}

/**
Expand Down
669 changes: 0 additions & 669 deletions src/test/resources/html/courses/bad-date.html

This file was deleted.

669 changes: 0 additions & 669 deletions src/test/resources/html/courses/bad-time.html

This file was deleted.

994 changes: 0 additions & 994 deletions src/test/resources/html/courses/bad.html

This file was deleted.

317 changes: 0 additions & 317 deletions src/test/resources/html/courses/comments-offset.html

This file was deleted.

Loading

0 comments on commit c71a440

Please sign in to comment.