Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Inlinetestdatagen #34

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions compiledtestdata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Run this

```sh
dub -- -i newdump.json -d ../compiledtestdata/source/dud/compiledtestdata/data.d -m "dud.compiledtestdata.data"
```

in the testdata folder if you have a dump called newdump.json in it
10 changes: 10 additions & 0 deletions compiledtestdata/dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"dependencies": {
"pkgdescription" : {
"path": "../pkgdescription",
"version": ">=0.0.0"
}
},
"name": "compiledtestdata",
"targetType": "library"
}
Empty file.
4 changes: 4 additions & 0 deletions pkgdescription/source/dud/pkgdescription/path.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ struct Path {
PathPlatform[] platforms;
}

Path pathFromString(string s) {
return Path(PathPlatform(UnprocessedPath(s, [Platform.all])));
}

struct PathPlatform {
UnprocessedPath path;
Platform[] platforms;
Expand Down
9 changes: 7 additions & 2 deletions semver/source/dud/semver/semver.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module dud.semver.semver;
@safe:

struct SemVer {
import std.array : empty;
import std.format : format;
@safe:

uint major;
Expand Down Expand Up @@ -50,8 +52,6 @@ struct SemVer {
}

string toString() const @safe pure {
import std.array : appender, empty;
import std.format : format;
string ret = format("%s.%s.%s", this.major, this.minor, this.patch);
if(!this.preRelease.empty) {
ret ~= format("-%-(%s.%)", this.preRelease);
Expand All @@ -61,4 +61,9 @@ struct SemVer {
}
return ret;
}

string toStringD() const @safe pure {
return format("SemVer(%s, %s, %s, %s, %s)", this.major, this.minor
, this.patch, this.preRelease, this.buildIdentifier);
}
}
4 changes: 4 additions & 0 deletions testdata/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"descriptiongetter": {
"path": "../descriptiongetter",
"version": ">=0.0.0"
},
"semver": {
"path": "../semver",
"version": ">=0.0.0"
}
},
"configurations": [
Expand Down
Loading