Skip to content

Commit

Permalink
Merge pull request #74 from atilaneves/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
atilaneves authored Sep 22, 2023
2 parents d6c9912 + e2f50c3 commit 3227669
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ jobs:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
- macos-11
dc:
- dmd-2.103.1
- dmd-2.105.2
- dmd-2.100.0
- ldc-1.32.2
- ldc-1.34.0
- ldc-1.28.0

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install D compiler
uses: dlang-community/setup-dlang@v1.3.0
Expand Down
2 changes: 1 addition & 1 deletion dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"fileVersion": 1,
"versions": {
"test_allocator": "0.3.4",
"unit-threaded": "2.0.2"
"unit-threaded": "2.1.7"
}
}
16 changes: 16 additions & 0 deletions tests/ut/vector.d
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,22 @@ import test_allocator;
vec.capacity.shouldBeGreaterThan(6);
}

@("TestAllocator shrink with length range invalidation")
@safe unittest {
static TestAllocator allocator;

scope vec = vector(&allocator, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
vec.capacity.should == 10;
scope rng = vec.range;

foreach(i; 0 .. 5)
rng.popFront;
rng.empty.should == false;

() @trusted { vec.shrink(5); }();
rng.empty.should == true;
}

@("TestAllocator copy")
@safe unittest {
static TestAllocator allocator;
Expand Down

0 comments on commit 3227669

Please sign in to comment.