-
Notifications
You must be signed in to change notification settings - Fork 208
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
Port utils::convert_text() and UTF-8 <-> locale converters to Rust #1455
Commits on Jan 28, 2021
-
Add rudimentary tests for utils::translit()
I don't see a way to make the testing any more thorough, as we're basically testing the platform's support for transliteration — there is nothing our tests can do to enable or disable that support.
Configuration menu - View commit details
-
Copy full SHA for 93f2117 - Browse repository at this point
Copy the full SHA 93f2117View commit details -
Port utils::translit() tests to Rust
They all pass, even with a dummy implementation that just returns `tocode`. I'll ameliorate that in the next commit.
Configuration menu - View commit details
-
Copy full SHA for cd01c21 - Browse repository at this point
Copy the full SHA cd01c21View commit details -
Test equivalence of C++ and Rust translit() implementations
This test currently fails, because Rust has a dummy implementation. As a reminder: we can't rely on conventional tests here because translit() is platform-independent, and there's no fixed known-good output for any given input. But we can compare two implementations to see if they behave the same — which is exactly what the test is doing.
Configuration menu - View commit details
-
Copy full SHA for 4577eed - Browse repository at this point
Copy the full SHA 4577eedView commit details -
Port utils::translit() to Rust
The "comparison test" which compares results of C++ and Rust implementations now pass, and will be removed in the next commit. This commit passed the CI, i.e. it works not just on my Linux machine, but also on Ubuntu Linux with various compilers, two macOS versions, and two FreeBSD versions.
Configuration menu - View commit details
-
Copy full SHA for 1236f1c - Browse repository at this point
Copy the full SHA 1236f1cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a4428c3 - Browse repository at this point
Copy the full SHA a4428c3View commit details -
Stop leaking iconv_t value in utils::translit
The inner call to iconv_open() creates a separate iconv_t value which is never deallocated. The impact of this is minuscule, since Newsboat runs through this code path at most once, but it's still nice to plug this little leak.
Configuration menu - View commit details
-
Copy full SHA for a9bf51e - Browse repository at this point
Copy the full SHA a9bf51eView commit details
Commits on Feb 1, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 52aef2f - Browse repository at this point
Copy the full SHA 52aef2fView commit details -
Port UTF-8 <-> locale converters to Rust
Unlike C++ tests, Rust tests don't show output if they pass. As a result, the user won't see warnings about the tests that are skipped due to missing locales. The next commit will fix that.
Configuration menu - View commit details
-
Copy full SHA for 9a6dbad - Browse repository at this point
Copy the full SHA 9a6dbadView commit details -
By default, skip Rust tests that require locales
As mentioned in the previous commit, Rust doesn't display stdout of tests which passed. As a result, we can't print a warning if we conditionally skip a test. An interested user can run `cargo test -- --show-output` and see if there are any warnings. But this is even worse than our C++ approach: in C++ it's sufficient to *look* at the output, but with Rust we'd have to *explicitly ask* for that output. So this commit moves the decision up, to the *invocation of Make*: `make check` (and `make ci-check`) runs all the tests *except* the ones that need locales, while `make NEWSBOAT_RUN_IGNORED_TESTS=1 check` runs *everything* (ditto for `ci-check`). This way, users and package builders can continue to run `make check` even if they don't have all the locales, and our CI can run a more strict version that checks everything.
Configuration menu - View commit details
-
Copy full SHA for e5f83bd - Browse repository at this point
Copy the full SHA e5f83bdView commit details -
Move hackers guide to doc/internal
It's not a user-facing documentation.
Configuration menu - View commit details
-
Copy full SHA for e22254c - Browse repository at this point
Copy the full SHA e22254cView commit details -
Revive the Newsboat hacker's guide
Most of it is (rightfully) marked as outdated, but the section on tests explains the purpose of `NEWSBOAT_RUN_IGNORED_TESTS` variable that I introduced a few commits ago.
Configuration menu - View commit details
-
Copy full SHA for cc6e75c - Browse repository at this point
Copy the full SHA cc6e75cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4555cc2 - Browse repository at this point
Copy the full SHA 4555cc2View commit details