Skip to content

Commit

Permalink
refactor(archive): format test names (#3984)
Browse files Browse the repository at this point in the history
* initial commit

* chore

* update test names

* tweaks

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
  • Loading branch information
timreichen and iuioiua authored Dec 18, 2023
1 parent fd8ecf2 commit 228d29e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions archive/tar_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Deno.test("createTarArchive", async function () {
assertEquals(wrote, 3072);
});

Deno.test("deflateTarArchive", async function () {
Deno.test("Tar() deflates tar archive", async function () {
const fileName = "output.txt";
const text = "hello tar world!";

Expand All @@ -67,7 +67,7 @@ Deno.test("deflateTarArchive", async function () {
assertEquals(untarText, text);
});

Deno.test("appendFileWithLongNameToTarArchive", async function (): Promise<
Deno.test("Tar() appends file with long name to tar archive", async function (): Promise<
void
> {
// 9 * 15 + 13 = 148 bytes
Expand Down Expand Up @@ -95,7 +95,7 @@ Deno.test("appendFileWithLongNameToTarArchive", async function (): Promise<
assertEquals(untarText, text);
});

Deno.test("directoryEntryType", async function () {
Deno.test("Tar() checks directory entry type", async function () {
const tar = new Tar();

tar.append("directory/", {
Expand Down
22 changes: 10 additions & 12 deletions archive/untar_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function createTar(entries: TestEntry[]): Promise<Tar> {
return tar;
}

Deno.test("untarAsyncIterator", async function () {
Deno.test("Untar() works as an async iterator", async () => {
const entries: TestEntry[] = [
{
name: "output.txt",
Expand Down Expand Up @@ -77,9 +77,7 @@ Deno.test("untarAsyncIterator", async function () {
assertEquals(entries.length, 0);
});

Deno.test("untarAsyncIteratorWithoutReadingBody", async function (): Promise<
void
> {
Deno.test("Untar() reads without body", async () => {
const entries: TestEntry[] = [
{
name: "output.txt",
Expand All @@ -106,8 +104,8 @@ Deno.test("untarAsyncIteratorWithoutReadingBody", async function (): Promise<
});

Deno.test(
"untarAsyncIteratorWithoutReadingBodyFromFileReader",
async function () {
"Untar() reads without body from FileReader",
async () => {
const entries: TestEntry[] = [
{
name: "output.txt",
Expand Down Expand Up @@ -142,7 +140,7 @@ Deno.test(
},
);

Deno.test("untarAsyncIteratorFromFileReader", async function () {
Deno.test("Untar() reads from FileReader", async () => {
const entries: TestEntry[] = [
{
name: "output.txt",
Expand Down Expand Up @@ -184,8 +182,8 @@ Deno.test("untarAsyncIteratorFromFileReader", async function () {
});

Deno.test(
"untarAsyncIteratorReadingLessThanRecordSize",
async function () {
"Untar() reads less than record size",
async () => {
// record size is 512
const bufSizes = [1, 53, 256, 511];

Expand Down Expand Up @@ -229,7 +227,7 @@ Deno.test(
},
);

Deno.test("untarLinuxGeneratedTar", async function () {
Deno.test("Untar() works with Linux generated tar", async () => {
const filePath = resolve(testdataDir, "deno.tar");
const file = await Deno.open(filePath, { read: true });

Expand Down Expand Up @@ -326,7 +324,7 @@ Deno.test("untarLinuxGeneratedTar", async function () {
});

Deno.test({
name: "test TarEntry",
name: "TarEntry() handles meta",
// only: true,
fn() {
// test TarEntry class
Expand Down Expand Up @@ -354,7 +352,7 @@ Deno.test({
},
});

Deno.test("untarArchiveWithLink", async function () {
Deno.test("Untar() handles archive with link", async function () {
const filePath = resolve(testdataDir, "with_link.tar");
const file = await Deno.open(filePath, { read: true });

Expand Down

0 comments on commit 228d29e

Please sign in to comment.