Repository navigation
Add History::clear() function - #536
Conversation
| let mut history = create_filled_example_history()?; | ||
| assert_ne!(history.count_all()?, 0); | ||
| history.clear().unwrap(); | ||
| assert_eq!(history.count_all()?, 0); |
There was a problem hiding this comment.
Maybe we should drop it and try to reopen it, to exclude a potential error case like we were seeing with nushell's sqlite "clear"
There was a problem hiding this comment.
Hmm, that's a good idea but it's a little tricky because create_filled_example_history() doesn't actually create files. It creates an in-memory database for SQLite and never sets the filename for the text history.
It would be nice to have tests that exercise filesystem functionality though 🤔
There was a problem hiding this comment.
I thought we had such tests but maybe that was before the sqlidation or are only on the individual implementations.
There was a problem hiding this comment.
@sholderbach I've added a test that uses a file-backed history.
There was a problem hiding this comment.
omg the reedline CI is so fast compared to Nushell 😭
|
Awesome! Thanks. |
Adds a
History::clear()function that deletes all history items. Closes #535.Will eventually close nushell/nushell#7991