Skip to content

Commit

Permalink
Minor Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPJones committed Jul 31, 2019
1 parent 31fa0b9 commit 6948937
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
11 changes: 6 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["ScottPJones <scottjones@alum.mit.edu>"]
keywords = ["Strings", "Characters", "Formatting", "Intern", "Unicode", "Regex"]
license = "MIT"
uuid = "7bddbee9-b4ee-5d4f-bf0b-c84b4398bbf6"
version = "1.0.0"
version = "1.0.1"

[deps]
ModuleInterfaceTools = "5cb8414e-7aab-5a03-a681-351269c074bf"
Expand Down Expand Up @@ -35,18 +35,19 @@ StrRegex = "2267b70d-4c4a-5da2-8395-98751c0d506a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[targets]
test = ["Test", "REPL", "BenchmarkTools"]
test = ["Test", "REPL", "BenchmarkTools", "Serialization"]

[compat]
julia = "^1.0.0"
PCRE2 = "≥ 1.0.0"
PCRE2 = "≥ 1.0.2"
Format = "≥ 1.0.0"
ModuleInterfaceTools = "≥ 1.0.0"
ModuleInterfaceTools = "≥ 1.0.1"
InternedStrings = "≥ 0.7.0"
StrTables = "≥ 1.0.0"
StrEntities = "≥ 1.0.0"
StrFormat = "≥ 1.0.0"
StrRegex = "≥ 1.0.0"
StrRegex = "≥ 1.0.1"
StrLiterals = "≥ 1.0.0"
14 changes: 7 additions & 7 deletions test/bench.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ dispbench(res) # Displays the results in a pretty format
=#

isdefined(Main, :STRS_SETUP) || include("setup.jl")
@static V6_COMPAT || (using Serialization)

@static V6_COMPAT || (using Serialization)
@static V6_COMPAT || (Base.iterate(it::Union{CodePoints,CodeUnits}) = iterate(it, 1))


Expand Down Expand Up @@ -230,7 +230,7 @@ function dispres(io, xres)
end
for i = 2:length(res)
rn = res[i]
rn[1] == "UniStr" && continue
#rn[1] == "UniStr" && continue
pr"\(io)\n\%-12.12s(rn[1])\%6.3f(sizes[i]/stats.len)"
tn = rn[3]
minres = min(length(t1), length(tn))
Expand Down Expand Up @@ -296,23 +296,23 @@ function douppercase(lines::Vector{<:AbstractString})
cnt
end

function countchars(lines::Vector{T}) where {T<:AbstractString}
function countchars(lines::Vector{<:AbstractString})
cnt = 0
@inbounds for text in lines, ch in text
cnt += 1
end
cnt
end

function countcps(lines::Vector{T}) where {T<:AbstractString}
function countcps(lines::Vector{<:AbstractString})
cnt = 0
for text in lines, ch in codepoints(text)
cnt += 1
end
cnt
end

function countcus(lines::Vector{T}) where {T<:AbstractString}
function countcus(lines::Vector{<:AbstractString})
cnt = 0
@inbounds for text in lines, cu in codeunits(text)
cnt += 1
Expand Down Expand Up @@ -670,7 +670,7 @@ const tests =
# (checkrepeat10, "repeat 10\nstring"),
(searchstr, "search\nstring"),
(searchchar, "search\nchar"),
(searchreg, "search\nregex"),
# (searchreg, "search\nregex"),
# (rsearchstr, "rsearch\nstring"),
# (rsearchchar, "rsearch\nchar"),
# (checkrepeat1c, "repeat 1\nchar"),
Expand Down Expand Up @@ -719,7 +719,7 @@ end

const mu_total = f"\<mu>s total"

function testperf(lines::Vector{T}, io, cnts, docnam, basetime, fast) where {T<:AbstractString}
function testperf(lines::Vector{<:AbstractString}, io, cnts, docnam, basetime, fast)
# Test performance
pr_ul(io, f"""\%-22s(docnam) \%12s("Result") \%12s(mu_total) """)
pr_ul(io, f"""\%12s("ns/line") \%12s("ns/char") \%12s("ns/byte")\n""")
Expand Down
1 change: 1 addition & 0 deletions test/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const test_legacy = false
using BenchmarkTools

using Strs
using Strs:V6_COMPAT

using REPL

Expand Down

2 comments on commit 6948937

@ScottPJones
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/2415

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.1 -m "<description of version>" 6948937ab08f8c2e4f021c073d710fceee973780
git push origin v1.0.1

Please sign in to comment.