Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use at-testset in unicode tests. #20445

Merged
merged 4 commits into from
Feb 6, 2017
Merged

Conversation

pkofod
Copy link
Contributor

@pkofod pkofod commented Feb 3, 2017

closes #18829

Is indentation usually changed? git footprint is smaller like this,but I can change it. Sanity check of names is welcome.

edit: btw, speaking of footprint: is there any reason why this is not just one test/unicode.jl file ?

@ararslan
Copy link
Member

ararslan commented Feb 3, 2017

Yes, the things inside testsets are typically indented one level.

@test string(Char(0x110000)) == "\ufffd"
@test convert(String, b"this is a test\xed\x80\x80") == "this is a test\ud000"
@testset "string indexing" begin
let str = String(b"this is a test\xed\x80")
Copy link
Member

Choose a reason for hiding this comment

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

The let actually isn't necessary now that it's in a testset, since str is scoped within the testset. Not that you need to change it, just letting you know. Doesn't hurt to keep the let.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, of course... too used to using lets in tests, so didn't even notice it. I can remove it if it's preferred.

@kshyatt kshyatt added test This change adds or pertains to unit tests unicode Related to unicode characters and encodings labels Feb 3, 2017
asymbol = ['(',')', '~', '$' ]
usymbol = ['∪', '∩', '⊂', '⊃', '√', '€', '¥', '↰', '△', '§']
for c in alphas
@test isalpha(c) == true
Copy link
Contributor

Choose a reason for hiding this comment

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

indented too far

@test_throws ArgumentError normalize_string("\u006e\u0303", compose=false, stripmark=true)
end

@testset "fastplus" begin# Make sure fastplus is called for coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

space between begin and #

@@ -1,7 +1,8 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

Copy link
Contributor

Choose a reason for hiding this comment

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

leave the first blank line here, it's significant to the license-headers script

@@ -1,43 +1,48 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

## Test for CESU-8 sequences
Copy link
Contributor

Choose a reason for hiding this comment

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

can remove the comment if the testset description makes it completely redundant


@testset "#issue #5939" begin # uft8proc character predicates
Copy link
Contributor

Choose a reason for hiding this comment

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

may as well have both the description and the issue number in the testset label


#issue #5939 uft8proc character predicates
let
@testset "uft8proc character predicates #5939" begin #
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for the trailing # if there isn't a comment any more

show(io, g)
check = "length-14 GraphemeIterator{String} for \"$str\""
@test String(take!(io)) == check
@testset "#3721, #6939" begin # up-to-date character widths
Copy link
Contributor

Choose a reason for hiding this comment

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

put comment wording in testset description here and on L276

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ofc... is there generally no limit to testset name lengths?

Copy link
Contributor

Choose a reason for hiding this comment

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

they probably don't need to be multi-line, but otherwise not really

@StefanKarpinski StefanKarpinski merged commit 0fa0c83 into JuliaLang:master Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test This change adds or pertains to unit tests unicode Related to unicode characters and encodings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch unicode tests to use testsets
5 participants