asset忘了上传了,重新传一下,增加了模板引擎(见README),修复了printable的目录bug
This commit is contained in:
commit
294abad18b
550 files changed
+62291
No files matched your search
@@ -0,0 +1,64 @@
|
||||
import { parse as parseToml } from "@std/toml";
|
||||
import { assertEquals } from "@std/assert";
|
||||
|
||||
// Deno.test("PFiles initialization", () => {
|
||||
// const pfiles = new PFiles("./mobile_src");
|
||||
// console.log(pfiles);
|
||||
// });
|
||||
|
||||
// Deno.test("PDF generate", async () => {
|
||||
// const builder = new DocuBuilder();
|
||||
// try {
|
||||
// await builder.with_browser();
|
||||
|
||||
// const cfg = JSON.parse(await Deno.readTextFile("config.json"));
|
||||
// for (const config of cfg.settings) {
|
||||
// console.debug(`Processing config: ${JSON.stringify(config)}`);
|
||||
// builder.with_files_sync(config.journal.from_directory);
|
||||
// builder.as_html_page();
|
||||
// await builder.build_as_pdf(config.playwright);
|
||||
// }
|
||||
// } finally {
|
||||
// await builder.close_browser();
|
||||
// }
|
||||
// });
|
||||
|
||||
// Deno.test({
|
||||
// name: "IndexBuilder test",
|
||||
// sanitizeOps: false,
|
||||
// sanitizeResources: false,
|
||||
// async fn() {
|
||||
// },
|
||||
// });
|
||||
import { ripgrep } from "ripgrep";
|
||||
Deno.test("default config is TOML with an asset base and vars table", async () => {
|
||||
const config = parseToml(await Deno.readTextFile("./config.toml")) as {
|
||||
asset_base: string;
|
||||
settings: unknown[];
|
||||
vars: Record<string, unknown>;
|
||||
};
|
||||
assertEquals(config.asset_base, "../../assets");
|
||||
assertEquals(config.settings.length, 3);
|
||||
assertEquals(typeof config.vars, "object");
|
||||
});
|
||||
|
||||
Deno.test("ripgrep test", async () => {
|
||||
let pattern = "NULL ";
|
||||
const cmd = new Deno.Command("rg", {
|
||||
args: ["-q", "-F", pattern],
|
||||
|
||||
stdin: "piped",
|
||||
stdout: "piped",
|
||||
stderr: "piped",
|
||||
});
|
||||
const child = cmd.spawn();
|
||||
const writer = child.stdin.getWriter();
|
||||
await writer.write(
|
||||
new TextEncoder().encode("This is a test string with NULL in it."),
|
||||
);
|
||||
writer.releaseLock();
|
||||
const { code, stdout, stderr } = await child.output();
|
||||
console.log(`Exit code: ${code}`);
|
||||
console.log(`stdout: ${new TextDecoder().decode(stdout)}`);
|
||||
console.log(`stderr: ${new TextDecoder().decode(stderr)}`);
|
||||
});
|
||||
Reference in new issue
Block a user