Skip to content

Commit

Permalink
Merge pull request #60 from JuliaString/spj/updateci
Browse files Browse the repository at this point in the history
Fix %c left/right justification
  • Loading branch information
ScottPJones authored May 14, 2021
2 parents 6fa2c12 + d266c26 commit 16e9ec8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 46 deletions.
22 changes: 4 additions & 18 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,27 @@
---
kind: pipeline
name: linux - arm - Julia 1.0

platform:
os: linux
arch: arm

steps:
- name: build
image: julia:1.0
commands:
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"

---
kind: pipeline
name: linux - arm64 - Julia 1.0
name: linux - arm64 - Julia 1.5

platform:
os: linux
arch: arm64

steps:
- name: build
image: julia:1.0
image: julia:1.5
commands:
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"

---
kind: pipeline
name: linux - arm64 - Julia 1.5
name: linux - arm64 - Julia 1.6

platform:
os: linux
arch: arm64

steps:
- name: build
image: julia:1.5
image: julia:1.6
commands:
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ keywords = ["Strings", "Formatting"]
license = "MIT"
name = "Format"
uuid = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8"
version = "1.3.0"
version = "1.3.1"

[deps]

Expand Down
4 changes: 2 additions & 2 deletions src/printf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ function _fmt(buf, pos, spec::FmtSpec{FmtChr}, arg)
width = spec.width - 1
width <= 0 && return writechar(buf, pos, ch)
if spec.leftalign
writechar(buf, padn(buf, pos, width), ch)
else
padn(buf, writechar(buf, pos, ch), width)
else
writechar(buf, padn(buf, pos, width), ch)
end
end

Expand Down
12 changes: 10 additions & 2 deletions test/speedtest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ function native_int()
@sprintf( "%10d", i )
end
end
@static if VERSION >= v"1.6"
function format_int()
fmt = Printf.Format( "%10d" )
for i in 1:BENCH_REP
Printf.format( fmt, i )
end
end
end
function runtime_int()
for i in 1:BENCH_REP
cfmt( "%10d", i )
Expand All @@ -33,8 +35,10 @@ end

println( "integer @sprintf speed")
@time native_int()
println( "integer format speed")
@time format_int()
@static if VERSION >= v"1.6"
println( "integer format speed")
@time format_int()
end
println( "integer cfmt speed")
@time runtime_int()
println( "integer cfmt spec speed")
Expand All @@ -50,12 +54,14 @@ function native_float()
@sprintf( "%10.4f", v)
end
end
@static if VERSION >= v"1.6"
function format_float()
fmt = Printf.Format( "%10.4f" )
for v in testflts
Printf.format( fmt, v )
end
end
end
function runtime_float()
for v in testflts
cfmt( "%10.4f", v)
Expand All @@ -77,8 +83,10 @@ end
println()
println( "float64 @sprintf speed")
@time native_float()
@static if VERSION >= v"1.6"
println( "float64 format speed")
@time format_float()
end
println( "float64 cfmt speed")
@time runtime_float()
println( "float64 cfmt spec speed")
Expand Down

0 comments on commit 16e9ec8

Please sign in to comment.