Skip to content

Commit 50429d1

Browse files
authored
Merge pull request #24 from miguelraz/master
Fixes for 1.0
2 parents 7db3f8d + 2e031b3 commit 50429d1

File tree

7 files changed

+40
-56
lines changed

7 files changed

+40
-56
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.6
7+
- 0.7
8+
- 1.0
89
- nightly
910
notifications:
1011
email: false
@@ -32,4 +33,4 @@ after_success:
3233
# push coverage results to Coveralls
3334
# - julia -e 'cd(Pkg.dir("InternedStrings")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
3435
# push coverage results to Codecov
35-
- julia -e 'cd(Pkg.dir("InternedStrings")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
36+
- julia -e 'Pkg.dir("InternedStrings"); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
julia 0.6
2-
Compat 0.52
1+
julia 0.7

appveyor.yml

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
5-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
6-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
7-
8-
## uncomment the following lines to allow failures on nightly julia
9-
## (tests will run but not make your overall status red)
10-
matrix:
11-
allow_failures:
12-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
13-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
3+
- julia_version: 0.7
4+
- julia_version: 1
5+
- julia_version: nightly
6+
7+
platform:
8+
- x86 # 32-bit
9+
- x64 # 64-bit
10+
11+
# # Uncomment the following lines to allow failures on nightly julia
12+
# # (tests will run but not make your overall status red)
13+
# matrix:
14+
# allow_failures:
15+
# - julia_version: latest
1416

1517
branches:
1618
only:
@@ -24,25 +26,18 @@ notifications:
2426
on_build_status_changed: false
2527

2628
install:
27-
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
28-
# If there's a newer build queued for the same PR, cancel this one
29-
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
30-
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
31-
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
32-
throw "There are newer queued builds for this pull request, failing early." }
33-
# Download most recent Julia Windows binary
34-
- ps: (new-object net.webclient).DownloadFile(
35-
$env:JULIA_URL,
36-
"C:\projects\julia-binary.exe")
37-
# Run installer silently, output to C:\projects\julia
38-
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
29+
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
3930

4031
build_script:
41-
# Need to convert from shallow to complete for Pkg.clone to work
42-
- IF EXIST .git\shallow (git fetch --unshallow)
43-
- C:\projects\julia\bin\julia -e "VERSION < v\"0.7.0-DEV\" || (using InteractiveUtils);
44-
versioninfo(); pkg = \"InternedStrings\";
45-
if VERSION < v\"0.7.0-DEV.5183\"; Pkg.clone(pwd(), pkg); else ; Pkg.up(); end"
32+
- echo "%JL_BUILD_SCRIPT%"
33+
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
4634

4735
test_script:
48-
- C:\projects\julia\bin\julia -e "Pkg.test(\"InternedStrings\")"
36+
- echo "%JL_TEST_SCRIPT%"
37+
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
38+
39+
# # Uncomment to support code coverage upload. Should only be enabled for packages
40+
# # which would have coverage gaps without running on Windows
41+
# on_success:
42+
# - echo "%JL_CODECOV_SCRIPT%"
43+
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"

src/InternedStrings.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@ Licensed under MIT License, see LICENSE.md
77
"""
88
module InternedStrings
99

10-
using Compat
11-
1210
export @i_str, intern
1311

1412
Base.@deprecate_binding(InternedString, String, true)
1513

16-
@static if VERSION < v"0.7.0-DEV"
17-
const ht_keyindex2! = Base.ht_keyindex2
18-
else
19-
using Base: ht_keyindex2!
20-
end
14+
using Base: ht_keyindex2!
2115

2216
########################
2317
# The pool/interning lookup core code
@@ -42,7 +36,7 @@ end
4236
# Not found, so add it,
4337
# and mark it as a reference we track to delete!
4438
kk::K = convert(K, key)
45-
@compat finalizer(wkd.finalizer, kk) # finalizer is set on the strong ref
39+
finalizer(wkd.finalizer, kk) # finalizer is set on the strong ref
4640
@inbounds Base._setindex!(wkd.ht, nothing, WeakRef(kk), -index)
4741
unlock(wkd.lock)
4842
return kk # Return the strong ref

test/all_kinds_of_types.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ end
4545
@test addr_eq(ex1, ex2)
4646
end
4747

48-
# Enable when https://github.com/JuliaLang/julia/issues/26939 is fixed
49-
false && @testset "BigFloat" begin
48+
@testset "BigFloat" begin
5049
let
5150
pi1 = intern(BigFloat(π))
5251
@test pi1 == BigFloat(π)

test/corefunctionality.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ end
6161
end
6262
end
6363

64-
using Compat.GC
64+
using Base.GC
6565
@testset "Garbage Collection 1" begin let
6666
empty!(InternedStrings.pool)
6767
@test length(InternedStrings.pool)==0
@@ -89,8 +89,8 @@ end end
8989
end end
9090

9191

92-
using Compat.Random
93-
srand(1)
92+
using Random
93+
Random.seed!(1)
9494
@testset "Garbage Collection stress test" begin let
9595
empty!(InternedStrings.pool)
9696
oldpoolsize = length(InternedStrings.pool)

test/runtests.jl

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
using InternedStrings
22

3-
const V6_COMPAT = VERSION < v"0.7.0-DEV"
4-
@static if V6_COMPAT
5-
using Base.Test
6-
unsafe_wrap(::Type{Vector{UInt8}}, str) = Vector{UInt8}(str)
7-
const objectid = object_id
8-
else
9-
using Test, Random
10-
const gc = GC.gc
11-
end
12-
addr_eq(a,b) = pointer(a) === pointer(b)
3+
4+
using Test, Random, Base.GC
5+
6+
addr_eq(a::String, b::String) = pointer(a) === pointer(b)
7+
addr_eq(a, b) = objectid(a) === objectid(b)
8+
139

1410
@testset "All kinds of types" begin include("all_kinds_of_types.jl") end
1511
@testset "String macro" begin include("string_macro.jl") end

0 commit comments

Comments
 (0)