Skip to content

Commit 16e9ec8

Browse files
authored
Merge pull request #60 from JuliaString/spj/updateci
Fix %c left/right justification
2 parents 6fa2c12 + d266c26 commit 16e9ec8

File tree

5 files changed

+17
-46
lines changed

5 files changed

+17
-46
lines changed

.drone.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,27 @@
11
---
22
kind: pipeline
3-
name: linux - arm - Julia 1.0
4-
5-
platform:
6-
os: linux
7-
arch: arm
8-
9-
steps:
10-
- name: build
11-
image: julia:1.0
12-
commands:
13-
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
14-
15-
---
16-
kind: pipeline
17-
name: linux - arm64 - Julia 1.0
3+
name: linux - arm64 - Julia 1.5
184

195
platform:
206
os: linux
217
arch: arm64
228

239
steps:
2410
- name: build
25-
image: julia:1.0
11+
image: julia:1.5
2612
commands:
2713
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
2814

2915
---
3016
kind: pipeline
31-
name: linux - arm64 - Julia 1.5
17+
name: linux - arm64 - Julia 1.6
3218

3319
platform:
3420
os: linux
3521
arch: arm64
3622

3723
steps:
3824
- name: build
39-
image: julia:1.5
25+
image: julia:1.6
4026
commands:
4127
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ keywords = ["Strings", "Formatting"]
2323
license = "MIT"
2424
name = "Format"
2525
uuid = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8"
26-
version = "1.3.0"
26+
version = "1.3.1"
2727

2828
[deps]
2929

src/printf.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ function _fmt(buf, pos, spec::FmtSpec{FmtChr}, arg)
209209
width = spec.width - 1
210210
width <= 0 && return writechar(buf, pos, ch)
211211
if spec.leftalign
212-
writechar(buf, padn(buf, pos, width), ch)
213-
else
214212
padn(buf, writechar(buf, pos, ch), width)
213+
else
214+
writechar(buf, padn(buf, pos, width), ch)
215215
end
216216
end
217217

test/speedtest.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ function native_int()
77
@sprintf( "%10d", i )
88
end
99
end
10+
@static if VERSION >= v"1.6"
1011
function format_int()
1112
fmt = Printf.Format( "%10d" )
1213
for i in 1:BENCH_REP
1314
Printf.format( fmt, i )
1415
end
1516
end
17+
end
1618
function runtime_int()
1719
for i in 1:BENCH_REP
1820
cfmt( "%10d", i )
@@ -33,8 +35,10 @@ end
3335

3436
println( "integer @sprintf speed")
3537
@time native_int()
36-
println( "integer format speed")
37-
@time format_int()
38+
@static if VERSION >= v"1.6"
39+
println( "integer format speed")
40+
@time format_int()
41+
end
3842
println( "integer cfmt speed")
3943
@time runtime_int()
4044
println( "integer cfmt spec speed")
@@ -50,12 +54,14 @@ function native_float()
5054
@sprintf( "%10.4f", v)
5155
end
5256
end
57+
@static if VERSION >= v"1.6"
5358
function format_float()
5459
fmt = Printf.Format( "%10.4f" )
5560
for v in testflts
5661
Printf.format( fmt, v )
5762
end
5863
end
64+
end
5965
function runtime_float()
6066
for v in testflts
6167
cfmt( "%10.4f", v)
@@ -77,8 +83,10 @@ end
7783
println()
7884
println( "float64 @sprintf speed")
7985
@time native_float()
86+
@static if VERSION >= v"1.6"
8087
println( "float64 format speed")
8188
@time format_float()
89+
end
8290
println( "float64 cfmt speed")
8391
@time runtime_float()
8492
println( "float64 cfmt spec speed")

0 commit comments

Comments
 (0)