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

test failure in lineedit.jl #7403

Closed
stevengj opened this issue Jun 24, 2014 · 5 comments
Closed

test failure in lineedit.jl #7403

stevengj opened this issue Jun 24, 2014 · 5 comments
Labels
REPL Julia's REPL (Read Eval Print Loop)

Comments

@stevengj
Copy link
Member

Just got

    JULIA test/lineedit
     * lineedit
exception on 1: ERROR: test failed: position(buf) == 0
 in error at error.jl:21
 in default_handler at test.jl:19
 in do_test at test.jl:39
 in anonymous at no file:145
 in runtests at /Users/stevenj/Code/julia/test/testdefs.jl:5
 in anonymous at multi.jl:652
 in run_work_thunk at multi.jl:613
 in remotecall_fetch at multi.jl:686
 in remotecall_fetch at multi.jl:701
 in anonymous at task.jl:1348
while loading lineedit.jl, in expression starting on line 142
ERROR: test failed: position(buf) == 0
 in error at error.jl:21
 in default_handler at test.jl:19
 in do_test at test.jl:39
 in anonymous at no file:145
 in runtests at /Users/stevenj/Code/julia/test/testdefs.jl:5
 in anonymous at multi.jl:652
 in run_work_thunk at multi.jl:613
 in remotecall_fetch at multi.jl:686
 in remotecall_fetch at multi.jl:701
 in anonymous at task.jl:1348
while loading lineedit.jl, in expression starting on line 142
while loading /Users/stevenj/Code/julia/test/runtests.jl, in expression starting on line 46

in MacOS 10.8.5.

@stevengj stevengj added the REPL label Jun 24, 2014
@stevengj
Copy link
Member Author

Weird.

Entering:

using Base.LineEdit
buf = IOBuffer()
LineEdit.edit_insert(buf, "â")
LineEdit.edit_move_left(buf)
println(position(buf))

at the REPL prints 0, but putting the same lines into a file and running them via include prints 1.

Ah... it looks like pasting "â" somehow results in an NFKC-normalized string in the Terminal. The following code always prints 1:

using Base.LineEdit
buf = IOBuffer()
s = "â"
LineEdit.edit_insert(buf, normalize_string(s, :NFKD))
LineEdit.edit_move_left(buf)
println(position(buf))

@stevengj
Copy link
Member Author

cc: @loladiro ... probably related to #6939

@jiahao
Copy link
Member

jiahao commented Jun 24, 2014

you mean @Keno

@stevengj
Copy link
Member Author

I think he should just pick some unpronounceable Unicode glyph.

@stevengj
Copy link
Member Author

Yes, it looks like this is the charwidth bug on MacOS 10.8 from #6939 :

[charwidth(c) for c in normalize_string("â", :NFKD)]
2-element Array{Int64,1}:
 1
 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

2 participants