add more tests and mark failing ones as todo

This commit is contained in:
pfg
2024-11-20 20:27:34 -08:00
parent 41ba9f01d0
commit 8b2b6fa54c

View File

@@ -20,19 +20,40 @@ describe("bun shell", () => {
// slow
expect(await $({ raw: ["echo " + 'a"a"'.repeat(1000000)] } as any).text()).toBe("aa".repeat(1000000) + "\n");
});
it("passes correct number of arguments with empty string substitutions", async () => {
it.todo("echo works 1", async () => expect(await $`echo -n`.text()).toBe(""));
it.todo("echo works 2", async () => expect(await $`echo -n abc`.text()).toBe("abc"));
it("echo works 3", async () => expect(await $`echo abc`.text()).toBe("abc\n"));
it("echo works 4", async () => expect(await $`echo`.text()).toBe("\n"));
it("echo works 5", async () => expect(await $`echo abc def`.text()).toBe("abc def\n"));
it.todo("echo works 6", async () => expect(await $`echo -s abc def`.text()).toBe("abcdef\n"));
it.todo("echo works 7", async () => expect(await $`echo -E abc def`.text()).toBe("abc def\n"));
it.todo("echo works 8", async () => expect(await $`echo abc\ndef`.text()).toBe("abc\\ndef\n"));
it.todo("echo works 9", async () => expect(await $`echo -e abc\ndef`.text()).toBe("abc\ndef\n"));
it.todo("passes correct number of arguments with empty string substitutions", async () => {
expect(await $`echo 1 ${""} 2`.text()).toBe("1 2\n");
});
it("passes correct number of arguments with empty string substitutions 2", async () => {
it.todo("passes correct number of arguments with empty string substitutions 2", async () => {
expect(await $`echo 1 "${""}" 2`.text()).toBe("1 2\n");
});
it("passes correct number of arguments with empty string substitutions 3", async () => {
it.todo("passes correct number of arguments with empty string substitutions 3", async () => {
expect(await $`echo 1 '${""}' 2`.text()).toBe("1 2\n");
});
it("passes correct number of arguments with empty double string quotes", async () => {
it.todo("passes correct number of arguments with empty strings", async () => {
expect(await $`echo 1 $(echo -n) 2`.text()).toBe("1 2\n");
});
it.todo("passes correct number of arguments with empty strings 2", async () => {
expect(await $`echo 1 $(echo) 2`.text()).toBe("1 2\n");
});
it.todo("passes correct number of arguments with empty strings 3", async () => {
expect(await $`echo 1 $(echo -n 3) 2`.text()).toBe("1 3 2\n");
});
it("passes correct number of arguments with empty strings 4", async () => {
expect(await $`echo 1 $(echo 3) 2`.text()).toBe("1 3 2\n");
});
it.todo("passes correct number of arguments with empty double string quotes", async () => {
expect(await $`echo "1" "" "2"`.text()).toBe("1 2\n");
});
it("passes correct number of arguments with empty single string quotes", async () => {
it.todo("passes correct number of arguments with empty single string quotes", async () => {
expect(await $`echo '1' '' '2'`.text()).toBe("1 2\n");
});
it("doesn't cause invalid js string ref error with a number after a string ref", async () => {