File tree Expand file tree Collapse file tree 5 files changed +19
-3
lines changed Expand file tree Collapse file tree 5 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
1818EzXML = " 0.9.1, 1"
1919Mocking = " 0.7"
2020RecipesBase = " 0.7, 0.8, 1"
21- ShortStrings = " 0.3.5 "
21+ ShortStrings = " 0.3.6 "
2222julia = " 1"
2323
2424[extras ]
Original file line number Diff line number Diff line change 1+ Subproject commit 65ca2364af105fc2647befe0b73ca3ecdd8c9f7a
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ using Printf
55using ShortStrings
66using Serialization
77using RecipesBase: RecipesBase, @recipe
8+ using ShortStrings: ShortString15
89using Unicode
910
1011import Dates: TimeZone, UTC
Original file line number Diff line number Diff line change 1+ # Ideally would always use ShortString15, but it's `hash` is broken on 32-bit systems.
2+ # https://github.com/JuliaString/MurmurHash3.jl/issues/12
3+ const FixedTimeZoneName = Int === Int64 ? ShortString15 : String
4+
15const FIXED_TIME_ZONE_REGEX = r"""
26 ^(?|
37 Z
@@ -30,7 +34,7 @@ const FIXED_TIME_ZONE_REGEX = r"""
3034A `TimeZone` with a constant offset for all of time.
3135"""
3236struct FixedTimeZone <: TimeZone
33- name:: Name
37+ name:: FixedTimeZoneName
3438 offset:: UTCOffset
3539end
3640
@@ -72,7 +76,7 @@ UTC+15:45:21
7276function FixedTimeZone (s:: AbstractString )
7377 s == " Z" && return UTC_ZERO
7478
75- m = match (FIXED_TIME_ZONE_REGEX, s )
79+ m = match (FIXED_TIME_ZONE_REGEX, String (s) )
7680 m === nothing && throw (ArgumentError (" Unrecognized time zone: $s " ))
7781
7882 coefficient = m[:sign ] == " -" ? - 1 : 1
Original file line number Diff line number Diff line change 4141 fixed_tz = FixedTimeZone (" UTC" )
4242 @test size (fixed_tz .== fixed_tz) == ()
4343 end
44+
45+ @testset " isbits" begin
46+ # We are not using ShortStrings on 32-bit due to hash being broken on 32-bit.
47+ # See https://github.com/JuliaString/MurmurHash3.jl/issues/12
48+ if Int === Int64
49+ @test isbits (FixedTimeZone (" 0123" ))
50+ else
51+ @test_broken isbits (FixedTimeZone (" 0123" ))
52+ end
53+ end
4454end
You can’t perform that action at this time.
0 commit comments