Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ripslash committed Feb 25, 2022
1 parent 05d0687 commit 4e98f03
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
21 changes: 21 additions & 0 deletions MarkdownParseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,25 @@ public void test8() throws IOException {
List morenames = List.of("https://something.com");
assertEquals(morenames, othername);
}
@Test
public void test9() throws IOException {
String variablename = Files.readString(Path.of("test-file(9).md"));
ArrayList<String> othername = MarkdownParse.getLinks(variablename);
List morenames = List.of("`google.com, google.com, ucsd.edu");
assertEquals(morenames, othername);
}
@Test
public void test10() throws IOException {
String variablename = Files.readString(Path.of("test-file(10).md"));
ArrayList<String> othername = MarkdownParse.getLinks(variablename);
List morenames = List.of("a.com, example.com");
assertEquals(morenames, othername);
}
@Test
public void test11() throws IOException {
String variablename = Files.readString(Path.of("test-file(11).md"));
ArrayList<String> othername = MarkdownParse.getLinks(variablename);
List morenames = List.of("https://ucsd-cse15l-w22.github.io/, ");
assertEquals(morenames, othername);
}
}
5 changes: 5 additions & 0 deletions test-file(10).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[a [nested link](a.com)](b.com)

[a nested parenthesized url](a.com(()))

[some escaped \[ brackets \]](example.com)
25 changes: 25 additions & 0 deletions test-file(11).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[this title text is really long and takes up more than
one line

and has some line breaks](
https://www.twitter.com
)

[this title text is really long and takes up more than
one line](
https://ucsd-cse15l-w22.github.io/
)


[this link doesn't have a closing parenthesis](github.com

And there's still some more text after that.

[this link doesn't have a closing parenthesis for a while](https://cse.ucsd.edu/



)

And then there's more text

8 changes: 8 additions & 0 deletions test-file(9).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

`[a link`](url.com)

[another link](`google.com)`

[`cod[e`](google.com)

[`code]`](ucsd.edu)

0 comments on commit 4e98f03

Please sign in to comment.