Skip to content

Commit 9ca6c87

Browse files
committed
Update API
1 parent bbb9dec commit 9ca6c87

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/StrFormat.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module StrFormat
99

1010
using APITools, Format
1111

12-
@api use StrAPI, StrLiterals
12+
@api extend StrAPI, StrLiterals
1313

1414
function _parse_format(str, pos, fun)
1515
ex, j = parse(Expr, str, pos; greedy=false)
@@ -70,8 +70,8 @@ function _parse_pyfmt(sx::Vector{Any}, s::AbstractString, unescape::Function,
7070
end
7171

7272
function __init__()
73-
interpolate['%'] = _parse_fmt
74-
interpolate['{'] = _parse_pyfmt
73+
StrLiterals.interpolate['%'] = _parse_fmt
74+
StrLiterals.interpolate['{'] = _parse_pyfmt
7575
end
7676

7777
end # module StrFormat

test/runtests.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
using APITools, Format
44

5-
@api init
5+
@api test StrAPI, StrLiterals
66

7-
@api test StrAPI, CharSetEncodings, Chars, StrBase, StrLiterals, StrFormat
7+
using StrFormat
88

99
@testset "C Formatting" begin
1010
@testset "int" begin
@@ -36,14 +36,14 @@ using APITools, Format
3636
end
3737
@testset "pointers" begin
3838
@static if Sys.WORD_SIZE == 64
39-
@test f"\%20p(0)" == " 0x0000000000000000"
40-
@test f"\%-20p(0)" == "0x0000000000000000 "
41-
elseif Sys.WORD_SIZE == 32
42-
@test f"\%20p(0)" == " 0x00000000"
43-
@test f"\%-20p(0)" == "0x00000000 "
44-
else
45-
@test false
46-
end
39+
@test f"\%20p(0)" == " 0x0000000000000000"
40+
@test f"\%-20p(0)" == "0x0000000000000000 "
41+
elseif Sys.WORD_SIZE == 32
42+
@test f"\%20p(0)" == " 0x00000000"
43+
@test f"\%-20p(0)" == "0x00000000 "
44+
else
45+
@test false
46+
end
4747
end
4848
@testset "float / BigFloat" begin
4949
for num in (1.2345, big"1.2345")

0 commit comments

Comments
 (0)