diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0141b14..bc1d704 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/dub.selections.json b/dub.selections.json index 2560b31..b702266 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -2,6 +2,6 @@ "fileVersion": 1, "versions": { "test_allocator": "0.3.4", - "unit-threaded": "2.0.2" + "unit-threaded": "2.1.7" } } diff --git a/tests/ut/vector.d b/tests/ut/vector.d index 393df2b..fe9b0f5 100644 --- a/tests/ut/vector.d +++ b/tests/ut/vector.d @@ -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;