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
48 lines (33 loc) · 1.37 KB
/
Copy pathMarkdownParseTest.java
File metadata and controls
48 lines (33 loc) · 1.37 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
import static org.junit.Assert.*;
import java.beans.Transient;
import org.junit.*;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.charset.StandardCharsets;
import java.util.*;
public class MarkdownParseTest {
@Test
public void addition() {
assertEquals(2, 1 + 1);
}
@Test
public void readFiles() throws IOException{
Path filename = Path.of("test-file.md");
String contents = Files.readString(filename);
List links = List.of("https://something.com", "some-page.html");
assertEquals("checks result", links, MarkdownParse.getLinks(contents));
Path filename2 = Path.of("test2_file.md");
String contents2 = Files.readString(filename2);
List links2 = List.of();
assertEquals("checks result 2", null, MarkdownParse.getLinks(contents2));
// Path filename3 = Path.of("test3-file.md");
// String contents3 = Files.readString(filename3);
// List links3 = List.of("www.edwin.com");
// assertEquals("checks result 3", links3, MarkdownParse.getLinks(contents3));
// Path filename4 = Path.of("test4-file.md");
// String contents4 = Files.readString(filename4);
// List links4 = List.of("https://CSE15L.com");
// assertEquals("checks result 4", links4, MarkdownParse.getLinks(contents4));
}
}