forked from nidhidhamnani/markdown-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkdownParseTest.java
More file actions
104 lines (104 loc) · 4.04 KB
/
MarkdownParseTest.java
File metadata and controls
104 lines (104 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import static org.junit.Assert.*;
import org.junit.*;
import java.util.ArrayList;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class MarkdownParseTest {
@Test
public void TestFile1() throws IOException {
ArrayList<String> list = new ArrayList<String>();
list.add("https://something.com");
list.add("some-thing.html");
Path fileName = Path.of("test-file.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestFile2() throws IOException {
ArrayList<String> list = new ArrayList<String>();
list.add("https://something.com");
list.add("some-page.html");
Path fileName = Path.of("test-file2.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestFile3() throws IOException {
ArrayList<String> list = new ArrayList<String>();
Path fileName = Path.of("test-file3.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestFile4() throws IOException {
ArrayList<String> list = new ArrayList<String>();
Path fileName = Path.of("test-file4.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestFile5() throws IOException {
ArrayList<String> list = new ArrayList<String>();
Path fileName = Path.of("test-file5.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestFile6() throws IOException {
ArrayList<String> list = new ArrayList<String>();
Path fileName = Path.of("test-file6.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestFile7() throws IOException {
ArrayList<String> list = new ArrayList<String>();
Path fileName = Path.of("test-file7.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestFile8() throws IOException {
ArrayList<String> list = new ArrayList<String>();
list.add("a link on the first line");
Path fileName = Path.of("test-file8.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestFile9() throws IOException {
ArrayList<String> list = new ArrayList<String>();
Path fileName = Path.of("test-file9.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestSnippet1() throws IOException {
ArrayList<String> list = new ArrayList<String>();
list.add("`google.com");
list.add("google.com");
list.add("ucsd.edu");
Path fileName = Path.of("snippet-1.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestSnippet2() throws IOException {
ArrayList<String> list = new ArrayList<String>();
list.add("a.com");
list.add("a.com(())");
list.add("example.com");
Path fileName = Path.of("snippet-2.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
@Test
public void TestSnippet3() throws IOException {
ArrayList<String> list = new ArrayList<String>();
list.add("https://sites.google.com/eng.ucsd.edu/cse-15l-spring-2022/schedule");
Path fileName = Path.of("snippet-3.md");
String content = Files.readString(fileName);
assertEquals(list, MarkdownParse.getLinks(content));
}
}