Worked on parsing
This commit is contained in:
25
parse_test.ts
Normal file
25
parse_test.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { assertArrayIncludes, assertEquals, assertStringIncludes } from "@std/assert";
|
||||
import { parseSummary } from "./parse.ts";
|
||||
|
||||
Deno.test(async function oldTemplate() {
|
||||
const filePath = './test/old_template.mw';
|
||||
|
||||
const fileContents = await Deno.readTextFile(filePath);
|
||||
|
||||
const desc = parseSummary(fileContents, "Old Template");
|
||||
assertEquals(desc.date, "2024-12-06")
|
||||
assertArrayIncludes(desc.teachers, ["Sebas"])
|
||||
assertStringIncludes(desc.patterns, "Sugar Tuck with Caress")
|
||||
});
|
||||
Deno.test(async function newTemplate() {
|
||||
const filePath = './test/new_template.mw';
|
||||
|
||||
const fileContents = await Deno.readTextFile(filePath);
|
||||
|
||||
const desc = parseSummary(fileContents, "New Template");
|
||||
|
||||
assertEquals(desc.date, "2023-12-02")
|
||||
assertArrayIncludes(desc.teachers, ["Sebastian Spindler"])
|
||||
console.dir(desc)
|
||||
assertStringIncludes(desc.patterns, "Blocking Free Spin")
|
||||
});
|
||||
Reference in New Issue
Block a user