Skip to content

Commit

Permalink
fix: xml test paths
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Dec 16, 2024
1 parent 6a6a9aa commit 674de39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion xml/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ export type options = {
*
* ```ts
* import { parse } from "./parse.ts"
* import { fromFileUrl } from "@std/path"
*
* using file = await Deno.open("bench/assets/small.xml")
* using file = await Deno.open(fromFileUrl(import.meta.resolve("./bench/assets/small.xml")))
* console.log(parse(file))
* ```
*
Expand Down
4 changes: 2 additions & 2 deletions xml/parse_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ if (runtime === "deno") {
// Other inputs

test("`parse()` using a reader", async () => {
using file = await Deno.open("bench/assets/small.xml")
using file = await Deno.open(fromFileUrl(import.meta.resolve("./bench/assets/small.xml")))
expect(
parse(file),
).toEqual(
Expand All @@ -1301,7 +1301,7 @@ if (runtime === "deno") {
const ignore = false && (i > 2) && (!Deno.env.get("CI"))
test(`\`parse()\` parse large files ~${(2 ** i)}Mb`, async () => {
await write(i)
expect(parse(await Deno.readTextFile(`bench/assets/x-${i}x-large.xml`))).not.toThrow()
expect(parse(await Deno.readTextFile(fromFileUrl(import.meta.resolve(`./bench/assets/x-${i}x-large.xml`))))).not.toThrow()
}, { permissions: { read: ["bench"], sys: ["uid"], write: ["bench"] }, ignore } as testing)
}
}

0 comments on commit 674de39

Please sign in to comment.