Skip to content

Commit

Permalink
Tests: Remove FSEntry.this dependency on TestDub
Browse files Browse the repository at this point in the history
The dependency should always be the other way around (TestDub depends on FSEntry),
and this is an easy win to move.
  • Loading branch information
Geod24 authored and dlang-bot committed Feb 22, 2024
1 parent ae426cd commit 612f2c5
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions source/dub/test/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,14 @@ public class TestDub : Dub
PackageSupplier[] extras = null,
SkipPackageSuppliers skip = SkipPackageSuppliers.none)
{
/// Create the fs & its base structure
this.fs = new FSEntry();
this.fs.mkdir(Paths.temp);
this.fs.mkdir(Paths.systemSettings);
this.fs.mkdir(Paths.userSettings);
this.fs.mkdir(Paths.userPackages);
this.fs.mkdir(Paths.cache);
this.fs.mkdir(ProjectPath);
if (dg !is null) dg(this.fs);
super(root, extras, skip);
}
Expand Down Expand Up @@ -562,20 +569,9 @@ public class FSEntry
}

/// Create the root of the filesystem, only usable from this module
private this (bool initialize = true)
private this ()
{
this.type = Type.Directory;

if (initialize) {
/// Create the base structure
this.mkdir(TestDub.Paths.temp);
this.mkdir(TestDub.Paths.systemSettings);
this.mkdir(TestDub.Paths.userSettings);
this.mkdir(TestDub.Paths.userPackages);
this.mkdir(TestDub.Paths.cache);

this.mkdir(TestDub.ProjectPath);
}
}

/// Get a direct children node, returns `null` if it can't be found
Expand Down

0 comments on commit 612f2c5

Please sign in to comment.