Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add a 'remove' method to allow testing on platforms with persistent local dictionaries #22

Open
hollandjg opened this issue Sep 29, 2015 · 3 comments

Comments

@hollandjg
Copy link

The tests (in spec/) of the .add method can only be run once on Mac OSX, which has a persistent local dictionary. On the second run, the word 'wwoorrdd' is in the dictionary, and the test no longer produces the correct output. The dictionary has to be edited by hand to remove this.

The solution may be to have a remove method which is used as part of the test teardown for tests of the 'add' function. This will leave the users' machine in a state where 'wwoorrdd' is not in the local dictionary, and the tests can be run as often as you like.

@beshur
Copy link

beshur commented Apr 21, 2016

Hi.
I see there is an implementation for Mac in this module:

void MacSpellchecker::Remove(const std::string& word) {

Upon reviewing the Windows iSpellchecker API, I found another - iSpellchecker2 API with the only method 'Remove':
https://msdn.microsoft.com/en-us/library/windows/desktop/mt422900(v=vs.85).aspx
iSpellchecker2 appeared in Windows 10 (according to some site: https://naughter.wordpress.com/2015/05/24/changes-in-the-windows-10-sdk-compared-to-windows-8-1-part-two/)

There is hacky way to remove words from user dictionary on Windows 8+: just removing them from %AppData%/Microsoft/Spelling//default.dic files (which are modified).
What do you think about this way?

cc @zcbenz

@matatk
Copy link

matatk commented Aug 14, 2017

I wonder if an alternative method to this would be to have an option to simply ignore any persistent local dictionary? This would have two effects:

  • Words already in the dictionary would be ignored (giving a standard environment for tests).
  • Words added to the dictionary in this session would not be persisted (meaning that test data would not be inadvertently added to the user's custom dictionary).

@matthew-a-thomas
Copy link

+1 for option to ignore local dictionaries.

Automated tests are not consistent without it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants