fix(learn): Added test for edge case (#39323)

* fix(learn): Added test for edge case

* Test checks edge cases for incorrect spelling in middle characters.

* fix: removed 'pen' sageTest

* the 'pen' points out that it is not the end of the first word to be tested for, but the end of the string.

However, this is explained clearly in the 'mountain' test below just as well.
This commit is contained in:
dyneskye 2020-07-27 15:43:59 +01:00 committed by GitHub
parent 17d9b43747
commit 4b7ad8447b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,8 +35,8 @@ tests:
testString: assert(confirmEnding("He has to give me a new name", "name") === true);
- text: <code>confirmEnding("Open sesame", "same")</code> should return true.
testString: assert(confirmEnding("Open sesame", "same") === true);
- text: <code>confirmEnding("Open sesame", "pen")</code> should return false.
testString: assert(confirmEnding("Open sesame", "pen") === false);
- text: <code>confirmEnding("Open sesame", "sage")</code> should return false.
testString: assert(confirmEnding("Open sesame", "sage") === false);
- text: <code>confirmEnding("Open sesame", "game")</code> should return false.
testString: assert(confirmEnding("Open sesame", "game") === false);
- text: <code>confirmEnding("If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing", "mountain")</code> should return false.