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
182 lines (159 loc) · 5.61 KB
/
Copy pathMarkdownParseTest.java
File metadata and controls
182 lines (159 loc) · 5.61 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import static org.junit.Assert.*;
import org.junit.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
public class MarkdownParseTest {
@Test
public void testsnippet1() {
try {
assertEquals(List.of("google.com"),
MarkdownParse.getLinks(Files.readString(Path.of("snippet1.md"))));
} catch (Exception e) {
throw new IllegalArgumentException();
}
}
@Test
public void testsnippet2() {
try {
assertEquals(List.of("a.com", "a.com(())", "example.com"),
MarkdownParse.getLinks(Files.readString(Path.of("snippet1.md"))));
} catch (Exception e) {
throw new IllegalArgumentException();
}
}
@Test
public void testsnippet3() {
try {
assertEquals(List.of("https://www.twitter.com",
"https://sites.google.com/eng.ucsd.edu/cse-15l-spring-2022/schedu",
"https://cse.ucsd.edu/"), MarkdownParse.getLinks(Files.readString(Path.of("snippet1.md"))));
} catch (Exception e) {
throw new IllegalArgumentException();
}
}
// @Test
// public void addition() {
// assertEquals(2, 1+1); // checks that 2 == 1+1
// }
// @Test
// public void testbasegetLinks() {
// try {
// assertEquals(List.of("https://something.com", "some-thing.html"), MarkdownParse.getLinks(Files.readString(Path.of("test-file.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test1getLinks() {
// try {
// assertEquals(List.of("https://www.youtube.com/"), MarkdownParse.getLinks(Files.readString(Path.of("test1.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test2getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test2.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test3getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test3.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test4getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test4.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test5getLinks() {
// try {
// assertEquals(List.of("hi.com"), MarkdownParse.getLinks(Files.readString(Path.of("test5.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test6getLinks() {
// try {
// assertEquals(List.of("thislinkhas()parenthesis.com"), MarkdownParse.getLinks(Files.readString(Path.of("test6.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test_file2getLinks() {
// try {
// assertEquals(List.of("https://something.com", "some-page.html"), MarkdownParse.getLinks(Files.readString(Path.of("test-file2.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test_file3getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test-file3.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test_file4getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test-file4.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test_file5getLinks() {
// try {
// assertEquals(List.of("page.com"), MarkdownParse.getLinks(Files.readString(Path.of("test-file5.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test_file6getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test-file6.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test_file7getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test-file7.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test_file8getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test-file8.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
// @Test
// public void test_file9getLinks() {
// try {
// assertEquals(List.of(), MarkdownParse.getLinks(Files.readString(Path.of("test-file8.md"))));
// } catch (Exception e) {
// throw new IllegalArgumentException();
// }
// }
}