Closed mbrubeck closed 7 years ago
@mbrubeck , @eefriedman, I am working on generating Rust unit test cases from BidiCharacterTest.txt, and the test cases essentially use the Fields 0(input string) and 4(output indices converted to output strings) and form unit test cases of the form "assert_eq!(reorder('input'), 'output');". Could you confirm whether this is correct? I am ignoring the levels information in the test cases since those should essentially be taken care of by the implementation.
Thanks!
Yes, this sounds good. Checking the levels may be useful too in some cases, but just checking the output is the most improtant part.
On Fri, Nov 27, 2015 at 2:19 PM, Vicky Katara notifications@github.com wrote:
@mbrubeck https://github.com/mbrubeck , I am working on generating Rust unit test cases from BidiCharacterTest.txt, and the test cases essentially use the Fields 0(input string) and 4(output indices converted to output strings) and form unit test cases of the form "assert_eq!(reorder('input'), 'output');". Could you confirm whether this is correct? I am ignoring the levels information in the test cases since those should essentially be taken care of by the implementation.
Thanks!
— Reply to this email directly or view it on GitHub https://github.com/servo/unicode-bidi/issues/1#issuecomment-160219271.
@mbrubeck, thanks for the confirmation. I had a followup question to the main issue. Since the files BidiTest.txt and BidiCharacterTest.txt are live, we will have to write python code which parses the files for test cases each time, and deletes the automated test cases added previously to lib.rs, and lastly add the new ones. Is this correct?
We should re-parse and re-generate the test cases only if someone manually runs the script to do it. See this discussion for more details.
Got it!
Thanks a lot!
@mbrubeck, should we add the python code for insertion of the test cases into a new python file, or should we add code to generate.py?
Either way is okay with me. If it's a lot of code (more than a handful of short functions), a separate file would probably be more readable. generate.py
could import the other file.
Combined with the code for deletion of existing test cases, it comes out to about 150 lines of code...
We'll move it to another file. Thanks @mbrubeck
@mbrubeck - Is it possible for us to have a Hangouts session or for us to call you? We have some doubts regarding the steps we have to implement as well as this step.
@samrudhisharma Sure, if you're available sometime today. You can find me in #servo on irc.mozilla.org to arrange a time, or just try calling +Matt Brubeck on Google Hangouts.
The Unicode consortium has a suite of conformance tests for the bidirectional algorithm, which can be found at:
We should add code to
tools/generate.py
to download these files and generate Rust unit tests for each of the test cases here.