forked from ucsd-cse15l-w22/markdown-parse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkdownParseTest.java
More file actions
85 lines (82 loc) · 3.02 KB
/
MarkdownParseTest.java
File metadata and controls
85 lines (82 loc) · 3.02 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
import static org.junit.Assert.*;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
//change
import org.junit.*;
//javac -cp .:lib/junit-4.13.2.jar:lib/hamcrest-core-1.3.jar MarkdownParseTest.java
//java -cp .:lib/junit-4.13.2.jar:lib/hamcrest-core-1.3.jar org.junit.runner.JUnitCore MarkdownParseTest
public class MarkdownParseTest {
@Test
public void addition() {
assertEquals(2, 1 + 1);
}
@Test
public void testfilemd()throws IOException{
Path fileName = Path.of("test-file.md");
String contents = Files.readString(fileName);
assertEquals(List.of("https://something.com", "some-page.html"), MarkdownParse.getLinks(contents));
}
@Test
public void testmd2()throws IOException{
Path fileName = Path.of("test2.md");
String contents = Files.readString(fileName);
assertEquals(List.of("link1.html"), MarkdownParse.getLinks(contents));
}
@Test
public void testmd3()throws IOException{
Path fileName = Path.of("test3.md");
String contents = Files.readString(fileName);
assertEquals(List.of(), MarkdownParse.getLinks(contents));
}
@Test
public void testfilemd2()throws IOException{
Path fileName = Path.of("test-file2.md");
String contents = Files.readString(fileName);
assertEquals(List.of("https://something.com", "some-page.html"), MarkdownParse.getLinks(contents));
}
@Test
public void testfilemd3()throws IOException{
Path fileName = Path.of("test-file3.md");
String contents = Files.readString(fileName);
assertEquals(List.of(), MarkdownParse.getLinks(contents));
}
@Test
public void testfilemd4()throws IOException{
Path fileName = Path.of("test-file4.md");
String contents = Files.readString(fileName);
assertEquals(List.of(), MarkdownParse.getLinks(contents));
}
@Test
public void testfilemd5()throws IOException{
Path fileName = Path.of("test-file5.md");
String contents = Files.readString(fileName);
assertEquals(List.of(), MarkdownParse.getLinks(contents));
}
@Test
public void testfilemd6()throws IOException{
Path fileName = Path.of("test-file5.md");
String contents = Files.readString(fileName);
assertEquals(List.of(), MarkdownParse.getLinks(contents));
}
@Test
public void testfilemd7()throws IOException{
Path fileName = Path.of("test-file7.md");
String contents = Files.readString(fileName);
assertEquals(List.of(), MarkdownParse.getLinks(contents));
}
@Test
public void testfilemd8()throws IOException{
Path fileName = Path.of("test-file8.md");
String contents = Files.readString(fileName);
assertEquals(List.of("a link on the first line"), MarkdownParse.getLinks(contents));
}
@Test
public void test4()throws IOException{
Path fileName = Path.of("test4.md");
String contents = Files.readString(fileName);
assertEquals(List.of(), MarkdownParse.getLinks(contents));
}
}