From fe936928fd3b67282c599f3f1258afcef2b708da Mon Sep 17 00:00:00 2001 From: Mathias Lang Date: Wed, 21 Feb 2024 20:57:24 +0100 Subject: [PATCH] Tests: Remove FSEntry.this dependency on TestDub The dependency should always be the other way around (TestDub depends on FSEntry), and this is an easy win to move. --- source/dub/test/base.d | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/source/dub/test/base.d b/source/dub/test/base.d index 46761feb1..a9dec6505 100644 --- a/source/dub/test/base.d +++ b/source/dub/test/base.d @@ -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); } @@ -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