-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from dlang/test-with-depracations
Various improvements
- Loading branch information
Showing
6 changed files
with
92 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Cross platform GitHub Actions CI for undeaD | ||
|
||
name: Testsuite | ||
|
||
# Only triggers on pushes to master & stable, as well as PR to master and stable | ||
# Sometimes reverts appear in the upstream repository (e.g. when the revert button | ||
# is clicked by a contributor with commit access), this should be tested as PR). | ||
# | ||
# Also note that Github actions does not retrigger on target branch changes, | ||
# hence the check on push. | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- stable | ||
push: | ||
branches: | ||
- master | ||
- stable | ||
# Use this branch name in your fork to test changes | ||
- github-actions | ||
|
||
jobs: | ||
main: | ||
name: Run | ||
strategy: | ||
# Default, disable if you want to debug | ||
fail-fast: false | ||
matrix: | ||
# Latest stable version, update at will | ||
os: [ macOS-10.15, ubuntu-20.04, windows-2019 ] | ||
dc: [ dmd-latest, ldc-latest, dmd-master, ldc-master ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
||
- name: Install D compiler - ${{ matrix.dc }} | ||
uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: ${{ matrix.dc }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: 'Build and Test' | ||
shell: bash | ||
run: | | ||
$DC --version | ||
dub build --compiler=$DC | ||
dub test --compiler=$DC -v |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name "undead" | ||
description "Obsolete Phobos modules, back from the dead" | ||
homepage "https://github.com/dlang/undeaD" | ||
authors "various" | ||
license "BSL-1.0" | ||
targetType "library" | ||
targetPath "bin" | ||
buildType "unittest" { | ||
buildOptions "debugMode" "debugInfo" "unittests" "deprecationErrors" "warningsAsErrors" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name "hello-from-the-dead" | ||
description "A test program that uses undeaD" | ||
authors "Petar Kirov" | ||
copyright "Copyright © 2020, Petar Kirov" | ||
license "BSL-1.0" | ||
dependency "undead" version="*" path="../.." | ||
targetPath "bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
static import std.string; | ||
|
||
void main() | ||
{ | ||
import undead.regexp : RegExp, sub; | ||
import std.stdio : writeln; | ||
|
||
string foo(RegExp r) { return "ss"; } | ||
|
||
auto r = sub("hello", "ll", delegate string(RegExp r) { return "ss"; }); | ||
assert(r == "hesso"); | ||
|
||
r = sub("hello", "l", delegate string(RegExp r) { return "l"; }, "g"); | ||
assert(r == "hello"); | ||
|
||
auto s = sub("Strap a rocket engine on a chicken.", | ||
"[ar]", | ||
delegate string (RegExp m) | ||
{ | ||
return std.string.toUpper(m[0]); | ||
}, | ||
"g"); | ||
assert(s == "StRAp A Rocket engine on A chicken."); | ||
s.writeln; | ||
} |