alacritty / vte

Parser for virtual terminal emulators
https://docs.rs/vte/
Apache License 2.0
242 stars 56 forks source link

Add test for UTF-8 Parsing #1

Closed jwilm closed 8 years ago

jwilm commented 8 years ago

The utf8parse package could use a test validating the implementation. My thought about how to do this is to find some complicated UTF-8 file and compare results of parsing it with this package's parser and the standard library's std::str::from_utf8().

Approach

Implement a utf8parse::Receiver for something wrapping a String. Read the UTF-8 test file into a buffer. for each byte in the buffer, advance() the utf8parse::Parser. After running all bytes through the parser, let the string be the actual value. Now, call String::from_utf8() on the test file buffer; let that be the expected value. Assert that those values are equal.

Links

eviltak commented 8 years ago

I love how you're adding easy issues for new contributors. Might be worth working on this project once I learn Rust. I need to create a very basic virtual terminal widget for a project anyway, and this project is the only recently updated project related to virtual terminals in Rust. Do you plan on making this a full blown virtual terminal like the inactive rust-terminal?

jwilm commented 8 years ago

@AravSinghal this project is just intended to be a state machine for the ansi terminal protocol, nothing more. I have plans for higher level libraries as well which will use this project internally.

julienfitz commented 8 years ago

I would like to take this! Thanks for bringing it to my attention.

jwilm commented 8 years ago

@lizbaillie all yours :)

julienfitz commented 8 years ago

@jwilm created a WIP PR - did not get very far this morning, but thought it might be helpful for you to see my progress so far, in case there was something I was doing obviously wrong from the get-go 😛

jwilm commented 8 years ago

Resolved in #2