mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
d13ef17a5d
This commit improves docs of the front-matter module. Specifically, the following things are done: - Use `@example` where appropriate to render the examples more beautifully - Split the big example attached to `createExtractor` function into smaller pieces so that each one has minimal yet meaningful example - Add `@returns` to the `test` function - Deduplicate `Format` type definition - Add a brief description to `Format` type Towards #3764 --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
32 lines
841 B
TypeScript
32 lines
841 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import { test } from "./test.ts";
|
|
import { extract } from "./toml.ts";
|
|
import {
|
|
runExtractTomlTests,
|
|
runExtractTomlTests2,
|
|
runExtractTypeErrorTests,
|
|
runTestInvalidInputTests,
|
|
runTestValidInputTests,
|
|
} from "./_test_utils.ts";
|
|
|
|
Deno.test("toml() tests valid input true", () => {
|
|
runTestValidInputTests("toml", test);
|
|
});
|
|
|
|
Deno.test("toml() tests invalid input false", () => {
|
|
runTestInvalidInputTests("toml", test);
|
|
});
|
|
|
|
Deno.test("toml() extracts type error on invalid input", () => {
|
|
runExtractTypeErrorTests("toml", extract);
|
|
});
|
|
|
|
Deno.test("toml() parses toml delineate by ---toml", async () => {
|
|
await runExtractTomlTests(extract);
|
|
});
|
|
|
|
Deno.test("toml() parses toml delineate by +++", async () => {
|
|
await runExtractTomlTests2(extract);
|
|
});
|