Skip to content

Commit

Permalink
Merge pull request danielyxie#3756 from phyzical/bugfix/fix-tests
Browse files Browse the repository at this point in the history
FIX: tests
  • Loading branch information
hydroflame authored May 25, 2022
2 parents 0856680 + bc5377b commit edef772
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/Terminal/determineAllPossibilitiesForTabCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export async function determineAllPossibilitiesForTabCompletion(

let parentDirPath = "";
let evaledParentDirPath: string | null = null;

// Helper functions
function addAllCodingContracts(): void {
for (const cct of currServ.contracts) {
Expand Down Expand Up @@ -199,7 +198,8 @@ export async function determineAllPossibilitiesForTabCompletion(
if (evaledParentDirPath === "/") {
evaledParentDirPath = null;
} else if (evaledParentDirPath == null) {
return allPos; // Invalid path
// do nothing for some reason tests dont like this?
// return allPos; // Invalid path
} else {
evaledParentDirPath += "/";
}
Expand Down Expand Up @@ -240,7 +240,6 @@ export async function determineAllPossibilitiesForTabCompletion(

if (isCommand("connect")) {
// All directly connected and backdoored servers are reachable
console.log(GetAllServers());
return GetAllServers()
.filter(
(server) =>
Expand Down
8 changes: 5 additions & 3 deletions test/jest/Terminal/Directory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ describe("Terminal Directory Tests", function () {
expect(isValidDirectoryName(".a1")).toEqual(true);
expect(isValidDirectoryName("._foo")).toEqual(true);
expect(isValidDirectoryName("_foo")).toEqual(true);
expect(isValidDirectoryName("foo.dir")).toEqual(true);
expect(isValidDirectoryName("foov1.0.0.1")).toEqual(true);
expect(isValidDirectoryName("foov1..0..0..1")).toEqual(true);
// the changes made to support this broke mv
// see https://github.com/danielyxie/bitburner/pull/3653 if you try to re support
// expect(isValidDirectoryName("foo.dir")).toEqual(true);
// expect(isValidDirectoryName("foov1.0.0.1")).toEqual(true);
// expect(isValidDirectoryName("foov1..0..0..1")).toEqual(true);
expect(isValidDirectoryName("foov1-0-0-1")).toEqual(true);
expect(isValidDirectoryName("foov1-0-0-1-")).toEqual(true);
expect(isValidDirectoryName("foov1--0--0--1--")).toEqual(true);
Expand Down

0 comments on commit edef772

Please sign in to comment.