Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed May 25, 2024
1 parent 30e7e43 commit b6487c7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
matrix:
version:
- '1'
- '~1.11.0-0'
os:
- ubuntu-latest
- macOS-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
@info "Not compatible with this release. No problem." exception=err
exit(0) # Exit immediately, as a success
end
env:
RETESTITEMS_NWORKERS: 4
RETESTITEMS_NWORKER_THREADS: 2
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
with:
Expand Down
17 changes: 17 additions & 0 deletions test/basictests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ function matmul!!(y, x, z)
return y
end

function get_similar(x)
@bb z = similar(x)
return z
end

@testset "copyto!" begin
x = [1.0, 1.0]
y = [0.0, 0.0]
Expand Down Expand Up @@ -88,3 +93,15 @@ end
@test matmul!!(y, x, z) == @SVector[2.0, 2.0]
@test y == @SVector[0.0, 0.0]
end

@testset "similar" begin
x = [1.0, 1.0]
z = get_similar(x)

@test_nowarn z[1]

x = BigFloat[1.0, 1.0]
z = get_similar(x)

@test_nowarn z[1] # Without correct similar this would throw UndefRefError
end

0 comments on commit b6487c7

Please sign in to comment.