improve bash command history importing

Fixes #2091
This commit is contained in:
Kurtis Rader
2017-02-08 20:50:57 -08:00
parent cf63d1b2a7
commit 0541a34201
3 changed files with 38 additions and 27 deletions

View File

@@ -3128,8 +3128,10 @@ void history_tests_t::test_history_formats(void) {
if (!f) {
err(L"Couldn't open file tests/history_sample_bash");
} else {
// It should skip over the export command since that's a bash-ism.
const wchar_t *expected[] = {L"echo supsup", L"history --help", L"echo foo", NULL};
// The results are in the reverse order that they appear in the bash history file.
// We don't expect whitespace to be elided.
const wchar_t *expected[] = {L"sleep 123", L" final line", L"echo supsup",
L"history --help", L"echo foo", NULL};
history_t &test_history = history_t::history_with_name(L"bash_import");
test_history.populate_from_bash(f);
if (!history_equals(test_history, expected)) {