mirror of
https://github.com/denoland/deno.git
synced 2024-10-30 09:08:00 -04:00
test(std/hash): make tests runnable from any directory (#7376)
This commit is contained in:
parent
f57a2c1e85
commit
7a8b27aa25
3 changed files with 9 additions and 6 deletions
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals } from "../testing/asserts.ts";
|
||||
import { Sha1, Message } from "./sha1.ts";
|
||||
import { join, resolve } from "../path/mod.ts";
|
||||
import { dirname, join, resolve, fromFileUrl } from "../path/mod.ts";
|
||||
|
||||
const testdataDir = resolve("hash", "testdata");
|
||||
const moduleDir = dirname(fromFileUrl(import.meta.url));
|
||||
const testdataDir = resolve(moduleDir, "testdata");
|
||||
|
||||
/** Handy function to convert an array/array buffer to a string of hex values. */
|
||||
function toHexString(value: number[] | ArrayBuffer): string {
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
import { Sha256, HmacSha256, Message } from "./sha256.ts";
|
||||
import { assertEquals } from "../testing/asserts.ts";
|
||||
import { join, resolve } from "../path/mod.ts";
|
||||
import { dirname, join, resolve, fromFileUrl } from "../path/mod.ts";
|
||||
|
||||
const testdataDir = resolve("hash", "testdata");
|
||||
const moduleDir = dirname(fromFileUrl(import.meta.url));
|
||||
const testdataDir = resolve(moduleDir, "testdata");
|
||||
|
||||
/** Handy function to convert an array/array buffer to a string of hex values. */
|
||||
function toHexString(value: number[] | ArrayBuffer): string {
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
import { Sha512, HmacSha512, Message } from "./sha512.ts";
|
||||
import { assertEquals } from "../testing/asserts.ts";
|
||||
import { join, resolve } from "../path/mod.ts";
|
||||
import { dirname, join, resolve, fromFileUrl } from "../path/mod.ts";
|
||||
|
||||
const testdataDir = resolve("hash", "testdata");
|
||||
const moduleDir = dirname(fromFileUrl(import.meta.url));
|
||||
const testdataDir = resolve(moduleDir, "testdata");
|
||||
|
||||
/** Handy function to convert an array/array buffer to a string of hex values. */
|
||||
function toHexString(value: number[] | ArrayBuffer): string {
|
||||
|
|
Loading…
Reference in a new issue