diff --git a/test/prebuild.js b/test/prebuild.js index 9ae97e8..a4df0e5 100644 --- a/test/prebuild.js +++ b/test/prebuild.js @@ -4,6 +4,11 @@ import test from 'ava' import { isValidHttpUrl } from '../helpers/check-types.js' import { buildReadmeAppList } from '../helpers/build-app-list.js' +import { + matchesWholeWord, + fuzzyMatchesWholeWord, + eitherMatches +} from '../helpers/matching.js' require('dotenv').config() @@ -146,3 +151,30 @@ test('README Apps are in alphbetical order', (t) => { }) + +const namesWithPlusses = [ + 'Xournal++', + 'Notepad++' +] + +test('Can match names with pluses', (t) => { + + + + // Sort apps in groups alphabetically + for ( const nameWithPluses of namesWithPlusses ) { + + const haystack = `FDKLS:KF ${nameWithPluses}NDFLSKFLSJDK` + + t.assert( matchesWholeWord( nameWithPluses, haystack ) ) + + t.assert( fuzzyMatchesWholeWord( nameWithPluses, haystack ) ) + + t.assert( eitherMatches( nameWithPluses, haystack ) ) + t.assert( eitherMatches( haystack, nameWithPluses ) ) + } + + t.pass() +}) + +