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"
18
18
EzXML = " 0.9.1, 1"
19
19
Mocking = " 0.7"
20
20
RecipesBase = " 0.7, 0.8, 1"
21
- ShortStrings = " 0.3.5 "
21
+ ShortStrings = " 0.3.6 "
22
22
julia = " 1"
23
23
24
24
[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
5
5
using ShortStrings
6
6
using Serialization
7
7
using RecipesBase: RecipesBase, @recipe
8
+ using ShortStrings: ShortString15
8
9
using Unicode
9
10
10
11
import 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
+
1
5
const FIXED_TIME_ZONE_REGEX = r"""
2
6
^(?|
3
7
Z
@@ -30,7 +34,7 @@ const FIXED_TIME_ZONE_REGEX = r"""
30
34
A `TimeZone` with a constant offset for all of time.
31
35
"""
32
36
struct FixedTimeZone <: TimeZone
33
- name:: Name
37
+ name:: FixedTimeZoneName
34
38
offset:: UTCOffset
35
39
end
36
40
@@ -72,7 +76,7 @@ UTC+15:45:21
72
76
function FixedTimeZone (s:: AbstractString )
73
77
s == " Z" && return UTC_ZERO
74
78
75
- m = match (FIXED_TIME_ZONE_REGEX, s )
79
+ m = match (FIXED_TIME_ZONE_REGEX, String (s) )
76
80
m === nothing && throw (ArgumentError (" Unrecognized time zone: $s " ))
77
81
78
82
coefficient = m[:sign ] == " -" ? - 1 : 1
Original file line number Diff line number Diff line change 41
41
fixed_tz = FixedTimeZone (" UTC" )
42
42
@test size (fixed_tz .== fixed_tz) == ()
43
43
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
44
54
end
You can’t perform that action at this time.
0 commit comments