fix: removed assert message arguments

This commit is contained in:
Randell Dawson 2020-03-06 08:38:19 -08:00 committed by Kristofer Koishigawa
parent 72bc067e6b
commit cc190aba99
5 changed files with 37 additions and 37 deletions

View File

@ -28,19 +28,19 @@ Write a function that takes an input array of words. The function should return
``` yml
tests:
- text: <code>findLongestChain</code> should be a function.
testString: assert(typeof findLongestChain == 'function', '<code>findLongestChain</code> should be a function.');
testString: assert(typeof findLongestChain == 'function');
- text: <code>findLongestChain(["certain", "each", "game", "involves", "starting", "with", "word"])</code> should return an array.
testString: assert(Array.isArray(findLongestChain(["certain", "each", "game", "involves", "starting", "with", "word"])), '<code>findLongestChain(["certain", "each", "game", "involves", "starting", "with", "word"])</code> should return an array.');
testString: assert(Array.isArray(findLongestChain(["certain", "each", "game", "involves", "starting", "with", "word"])));
- text: <code>findLongestChain(["certain", "each", "game", "involves", "starting", "with", "word"])</code> should return <code>["involves", "starting", "game", "each"]</code>.
testString: assert.deepEqual(findLongestChain(["certain", "each", "game", "involves", "starting", "with", "word"]), ['involves', 'starting', 'game', 'each'], '<code>findLongestChain(["certain", "each", "game", "involves", "starting", "with", "word"])</code> should return <code>["involves", "starting", "game", "each"]</code>.');
testString: assert.deepEqual(findLongestChain(["certain", "each", "game", "involves", "starting", "with", "word"]), ['involves', 'starting', 'game', 'each']);
- text: <code>findLongestChain(["audino", "bagon", "kangaskhan", "banette", "bidoof", "braviary", "exeggcute", "yamask"])</code> should return <code>["braviary", "yamask", "kangaskhan"]</code>
testString: assert.deepEqual(findLongestChain(["audino", "bagon", "kangaskhan", "banette", "bidoof", "braviary", "exeggcute", "yamask"]), ['braviary', 'yamask', 'kangaskhan'], '<code>findLongestChain(["audino", "bagon", "kangaskhan", "banette", "bidoof", "braviary", "exeggcute", "yamask"])</code> should return <code>["braviary", "yamask", "kangaskhan"]</code>.');
testString: assert.deepEqual(findLongestChain(["audino", "bagon", "kangaskhan", "banette", "bidoof", "braviary", "exeggcute", "yamask"]), ['braviary', 'yamask', 'kangaskhan']);
- text: <code>findLongestChain(["harp", "poliwrath", "poochyena", "porygon2", "porygonz", "archana"])</code> should return <code>["poliwrath", "harp", "poochyena", "archana"]</code>.
testString: assert.deepEqual(findLongestChain(["harp", "poliwrath", "poochyena", "porygon2", "porygonz", "archana"]), ['poliwrath', 'harp', 'poochyena', 'archana'], '<code>findLongestChain(["harp", "poliwrath", "poochyena", "porygon2", "porygonz", "archana"])</code> should return <code>["poliwrath", "harp", "poochyena", "archana"]</code>.');
testString: assert.deepEqual(findLongestChain(["harp", "poliwrath", "poochyena", "porygon2", "porygonz", "archana"]), ['poliwrath', 'harp', 'poochyena', 'archana']);
- text: <code>findLongestChain(["scolipede", "elephant", "zeaking", "sealeo", "silcoon", "tigers"])</code> should return <code>["scolipede", "elephant", "tigers", "sealeo"]</code>.
testString: assert.deepEqual(findLongestChain(["scolipede", "elephant", "zeaking", "sealeo", "silcoon", "tigers"]), ['scolipede', 'elephant', 'tigers', 'sealeo'], '<code>findLongestChain(["scolipede", "elephant", "zeaking", "sealeo", "silcoon", "tigers"])</code> should return <code>["scolipede", "elephant", "tigers", "sealeo"]</code>.');
testString: assert.deepEqual(findLongestChain(["scolipede", "elephant", "zeaking", "sealeo", "silcoon", "tigers"]), ['scolipede', 'elephant', 'tigers', 'sealeo']);
- text: <code>findLongestChain(["loudred", "lumineon", "lunatone", "machamp", "magnezone", "nosepass", "petilil", "pidgeotto", "pikachu"])</code> should return <code>["machamp", "petilil", "lumineon", "nosepass"]</code>.
testString: assert.deepEqual(findLongestChain(["loudred", "lumineon", "lunatone", "machamp", "magnezone", "nosepass", "petilil", "pidgeotto", "pikachu"]), ['machamp', 'petilil', 'lumineon', 'nosepass'], '<code>findLongestChain(["loudred", "lumineon", "lunatone", "machamp", "magnezone", "nosepass", "petilil", "pidgeotto", "pikachu"])</code> should return <code>["machamp", "petilil", "lumineon", "nosepass"]</code>.');
testString: assert.deepEqual(findLongestChain(["loudred", "lumineon", "lunatone", "machamp", "magnezone", "nosepass", "petilil", "pidgeotto", "pikachu"]), ['machamp', 'petilil', 'lumineon', 'nosepass']);
```
</section>

View File

@ -23,21 +23,21 @@ For example, given the string "ab", your function should return <code>[['a', 1],
``` yml
tests:
- text: <code>letterFrequency</code> should be a function.
testString: assert(typeof letterFrequency == 'function', '<code>letterFrequency</code> should be a function.');
testString: assert(typeof letterFrequency == 'function');
- text: <code>letterFrequency("Not all that Mrs. Bennet, however")</code> should return an array.
testString: assert(Array.isArray(letterFrequency("Not all that Mrs. Bennet, however")), '<code>letterFrequency("Not all that Mrs. Bennet, however")</code> should return an array.');
testString: assert(Array.isArray(letterFrequency("Not all that Mrs. Bennet, however")));
- text: <code>letterFrequency("Not all that Mrs. Bennet, however")</code> should return <code>[[" ", 5], [", ", 1], [".", 1], ["B", 1], ["M", 1], ["N", 1], ["a", 2], ["e", 4], ["h", 2], ["l", 2], ["n", 2], ["o", 2], ["r", 2], ["s", 1], ["t", 4], ["v", 1], ["w", 1]]</code>.
testString: assert.deepEqual(letterFrequency("Not all that Mrs. Bennet, however"), [[' ', 5], [',', 1], ['.', 1], ['B', 1], ['M', 1], ['N', 1], ['a', 2], ['e', 4], ['h', 2], ['l', 2], ['n', 2], ['o', 2], ['r', 2], ['s', 1], ['t', 4], ['v', 1], ['w', 1]], '<code>letterFrequency("Not all that Mrs. Bennet, however")</code> should return <code>[[" ", 5], [", ", 1], [".", 1], ["B", 1], ["M", 1], ["N", 1], ["a", 2], ["e", 4], ["h", 2], ["l", 2], ["n", 2], ["o", 2], ["r", 2], ["s", 1], ["t", 4], ["v", 1], ["w", 1]]</code>.');
testString: assert.deepEqual(letterFrequency("Not all that Mrs. Bennet, however"), [[' ', 5], [',', 1], ['.', 1], ['B', 1], ['M', 1], ['N', 1], ['a', 2], ['e', 4], ['h', 2], ['l', 2], ['n', 2], ['o', 2], ['r', 2], ['s', 1], ['t', 4], ['v', 1], ['w', 1]]);
- text: <code>letterFrequency("daughters, could ask on the ")</code> should return <code>[[' ',5],[',',1],['a',2],['c',1],['d',2],['e',2],['g',1],['h',2],['k',1],['l',1],['n',1],['o',2],['r',1],['s',2],['t',2],['u',2]]</code>.
testString: assert.deepEqual(letterFrequency("daughters, could ask on the "), [[' ', 5], [',', 1], ['a', 2], ['c', 1], ['d', 2], ['e', 2], ['g', 1], ['h', 2], ['k', 1], ['l', 1], ['n', 1], ['o', 2], ['r', 1], ['s', 2], ['t', 2], ['u', 2]], '<code>letterFrequency("daughters, could ask on the ")</code> should return <code>[[" ", 5], [", ", 1], ["a", 2], ["c", 1], ["d", 2], ["e", 2], ["g", 1], ["h", 2], ["k", 1], ["l", 1], ["n", 1], ["o", 2], ["r", 1], ["s", 2], ["t", 2], ["u", 2]]</code>.');
testString: assert.deepEqual(letterFrequency("daughters, could ask on the "), [[' ', 5], [',', 1], ['a', 2], ['c', 1], ['d', 2], ['e', 2], ['g', 1], ['h', 2], ['k', 1], ['l', 1], ['n', 1], ['o', 2], ['r', 1], ['s', 2], ['t', 2], ['u', 2]]);
- text: <code>letterFrequency("husband any satisfactory description")</code> should return <code>[[" ", 3], ["a", 4], ["b", 1], ["c", 2], ["d", 2], ["e", 1], ["f", 1], ["h", 1], ["i", 3], ["n", 3], ["o", 2], ["p", 1], ["r", 2], ["s", 4], ["t", 3], ["u", 1], ["y", 2]]</code>.
testString: assert.deepEqual(letterFrequency("husband any satisfactory description"), [[' ', 3], ['a', 4], ['b', 1], ['c', 2], ['d', 2], ['e', 1], ['f', 1], ['h', 1], ['i', 3], ['n', 3], ['o', 2], ['p', 1], ['r', 2], ['s', 4], ['t', 3], ['u', 1], ['y', 2]], '<code>letterFrequency("husband any satisfactory description")</code> should return <code>[[" ", 3], ["a", 4], ["b", 1], ["c", 2], ["d", 2], ["e", 1], ["f", 1], ["h", 1], ["i", 3], ["n", 3], ["o", 2], ["p", 1], ["r", 2], ["s", 4], ["t", 3], ["u", 1], ["y", 2]]</code>.');
testString: assert.deepEqual(letterFrequency("husband any satisfactory description"), [[' ', 3], ['a', 4], ['b', 1], ['c', 2], ['d', 2], ['e', 1], ['f', 1], ['h', 1], ['i', 3], ['n', 3], ['o', 2], ['p', 1], ['r', 2], ['s', 4], ['t', 3], ['u', 1], ['y', 2]]);
- text: <code>letterFrequency("in various ways--with barefaced")</code> should return <code>[[" ", 3], ["-", 2], ["a", 4], ["b", 1], ["c", 1], ["d", 1], ["e", 2], ["f", 1], ["h", 1], ["i", 3], ["n", 1], ["o", 1], ["r", 2], ["s", 2], ["t", 1], ["u", 1], ["v", 1], ["w", 2], ["y", 1]]</code>.
testString: assert.deepEqual(letterFrequency("in various ways--with barefaced"), [[' ', 3], ['-', 2], ['a', 4], ['b', 1], ['c', 1], ['d', 1], ['e', 2], ['f', 1], ['h', 1], ['i', 3], ['n', 1], ['o', 1], ['r', 2], ['s', 2], ['t', 1], ['u', 1], ['v', 1], ['w', 2], ['y', 1]], '<code>letterFrequency("in various ways--with barefaced")</code> should return <code>[[" ", 3], ["-", 2], ["a", 4], ["b", 1], ["c", 1], ["d", 1], ["e", 2], ["f", 1], ["h", 1], ["i", 3], ["n", 1], ["o", 1], ["r", 2], ["s", 2], ["t", 1], ["u", 1], ["v", 1], ["w", 2], ["y", 1]]</code>.');
testString: assert.deepEqual(letterFrequency("in various ways--with barefaced"), [[' ', 3], ['-', 2], ['a', 4], ['b', 1], ['c', 1], ['d', 1], ['e', 2], ['f', 1], ['h', 1], ['i', 3], ['n', 1], ['o', 1], ['r', 2], ['s', 2], ['t', 1], ['u', 1], ['v', 1], ['w', 2], ['y', 1]]);
- text: <code>letterFrequency("distant surmises; but he eluded")</code> should return <code>[[" ", 4], ["; ", 1], ["a", 1], ["b", 1], ["d", 3], ["e", 4], ["h", 1], ["i", 2], ["l", 1], ["m", 1], ["n", 1], ["r", 1], ["s", 4], ["t", 3], ["u", 3]]</code>.
testString: assert.deepEqual(letterFrequency("distant surmises; but he eluded"), [[' ', 4], [';', 1], ['a', 1], ['b', 1], ['d', 3], ['e', 4], ['h', 1], ['i', 2], ['l', 1], ['m', 1], ['n', 1], ['r', 1], ['s', 4], ['t', 3], ['u', 3]], '<code>letterFrequency("distant surmises; but he eluded")</code> should return <code>[[" ", 4], ["; ", 1], ["a", 1], ["b", 1], ["d", 3], ["e", 4], ["h", 1], ["i", 2], ["l", 1], ["m", 1], ["n", 1], ["r", 1], ["s", 4], ["t", 3], ["u", 3]]</code>.');
testString: assert.deepEqual(letterFrequency("distant surmises; but he eluded"), [[' ', 4], [';', 1], ['a', 1], ['b', 1], ['d', 3], ['e', 4], ['h', 1], ['i', 2], ['l', 1], ['m', 1], ['n', 1], ['r', 1], ['s', 4], ['t', 3], ['u', 3]]);
- text: <code>letterFrequency("last obliged to accept the second-hand,")</code> should return <code>[[" ", 5], [", ", 1], ["-", 1], ["a", 3], ["b", 1], ["c", 3], ["d", 3], ["e", 4], ["g", 1], ["h", 2], ["i", 1], ["l", 2], ["n", 2], ["o", 3], ["p", 1], ["s", 2], ["t", 4]]</code>.
testString: assert.deepEqual(letterFrequency("last obliged to accept the second-hand,"), [[' ', 5], [',', 1], ['-', 1], ['a', 3], ['b', 1], ['c', 3], ['d', 3], ['e', 4], ['g', 1], ['h', 2], ['i', 1], ['l', 2], ['n', 2], ['o', 3], ['p', 1], ['s', 2], ['t', 4]], '<code>letterFrequency("last obliged to accept the second-hand,")</code> should return <code>[[" ", 5], [", ", 1], ["-", 1], ["a", 3], ["b", 1], ["c", 3], ["d", 3], ["e", 4], ["g", 1], ["h", 2], ["i", 1], ["l", 2], ["n", 2], ["o", 3], ["p", 1], ["s", 2], ["t", 4]]</code>.');
testString: assert.deepEqual(letterFrequency("last obliged to accept the second-hand,"), [[' ', 5], [',', 1], ['-', 1], ['a', 3], ['b', 1], ['c', 3], ['d', 3], ['e', 4], ['g', 1], ['h', 2], ['i', 1], ['l', 2], ['n', 2], ['o', 3], ['p', 1], ['s', 2], ['t', 4]]);
```
</section>

View File

@ -29,21 +29,21 @@ Write a function that returns the Levenshtein distance between two strings given
``` yml
tests:
- text: <code>levenshtein</code> should be a function.
testString: assert(typeof levenshtein == 'function', '<code>levenshtein</code> should be a function.');
testString: assert(typeof levenshtein == 'function');
- text: <code>levenshtein("mist", "dist")</code> should return a number.
testString: assert(typeof levenshtein("mist", "dist") == 'number', '<code>levenshtein("mist", "dist")</code> should return a number.');
testString: assert(typeof levenshtein("mist", "dist") == 'number');
- text: <code>levenshtein("mist", "dist")</code> should return <code>1</code>.
testString: assert.equal(levenshtein("mist", "dist"), 1, '<code>levenshtein("mist", "dist")</code> should return <code>1</code>.');
testString: assert.equal(levenshtein("mist", "dist"), 1);
- text: <code>levenshtein("tier", "tor")</code> should return <code>2</code>.
testString: assert.equal(levenshtein("tier", "tor"), 2, '<code>levenshtein("tier", "tor")</code> should return <code>2</code>.');
testString: assert.equal(levenshtein("tier", "tor"), 2);
- text: <code>levenshtein("kitten", "sitting")</code> should return <code>3</code>.
testString: assert.equal(levenshtein("kitten", "sitting"), 3, '<code>levenshtein("kitten", "sitting")</code> should return <code>3</code>.');
testString: assert.equal(levenshtein("kitten", "sitting"), 3);
- text: <code>levenshtein("stop", "tops")</code> should return <code>2</code>.
testString: assert.equal(levenshtein("stop", "tops"), 2, '<code>levenshtein("stop", "tops")</code> should return <code>2</code>.');
testString: assert.equal(levenshtein("stop", "tops"), 2);
- text: <code>levenshtein("rosettacode", "raisethysword")</code> should return <code>8</code>.
testString: assert.equal(levenshtein("rosettacode", "raisethysword"), 8, '<code>levenshtein("rosettacode", "raisethysword")</code> should return <code>8</code>.');
testString: assert.equal(levenshtein("rosettacode", "raisethysword"), 8);
- text: <code>levenshtein("mississippi", "swiss miss")</code> should return <code>8</code>.
testString: assert.equal(levenshtein("mississippi", "swiss miss"), 8, '<code>levenshtein("mississippi", "swiss miss")</code> should return <code>8</code>.');
testString: assert.equal(levenshtein("mississippi", "swiss miss"), 8);
```
</section>

View File

@ -29,19 +29,19 @@ Write a function that takes $r_0,a,c,m,n$ as parameters and returns $r_n$.
``` yml
tests:
- text: <code>linearCongGenerator</code> should be a function.
testString: assert(typeof linearCongGenerator == 'function', '<code>linearCongGenerator</code> should be a function.');
testString: assert(typeof linearCongGenerator == 'function');
- text: <code>linearCongGenerator(324, 1145, 177, 2148, 3)</code> should return a number.
testString: assert(typeof linearCongGenerator(324, 1145, 177, 2148, 3) == 'number', '<code>linearCongGenerator(324, 1145, 177, 2148, 3)</code> should return a number.');
testString: assert(typeof linearCongGenerator(324, 1145, 177, 2148, 3) == 'number');
- text: <code>linearCongGenerator(324, 1145, 177, 2148, 3)</code> should return <code>855</code>.
testString: assert.equal(linearCongGenerator(324, 1145, 177, 2148, 3), 855, '<code>linearCongGenerator(324, 1145, 177, 2148, 3)</code> should return <code>855</code>.');
testString: assert.equal(linearCongGenerator(324, 1145, 177, 2148, 3), 855);
- text: <code>linearCongGenerator(234, 11245, 145, 83648, 4)</code> should return <code>1110</code>.
testString: assert.equal(linearCongGenerator(234, 11245, 145, 83648, 4), 1110, '<code>linearCongGenerator(234, 11245, 145, 83648, 4)</code> should return <code>1110</code>.');
testString: assert.equal(linearCongGenerator(234, 11245, 145, 83648, 4), 1110);
- text: <code>linearCongGenerator(85, 11, 1234, 214748, 5)</code> should return <code>62217</code>.
testString: assert.equal(linearCongGenerator(85, 11, 1234, 214748, 5), 62217, '<code>linearCongGenerator(85, 11, 1234, 214748, 5)</code> should return <code>62217</code>.');
testString: assert.equal(linearCongGenerator(85, 11, 1234, 214748, 5), 62217);
- text: <code>linearCongGenerator(0, 1103515245, 12345, 2147483648, 1)</code> should return <code>12345</code>.
testString: assert.equal(linearCongGenerator(0, 1103515245, 12345, 2147483648, 1), 12345, '<code>linearCongGenerator(0, 1103515245, 12345, 2147483648, 1)</code> should return <code>12345</code>.');
testString: assert.equal(linearCongGenerator(0, 1103515245, 12345, 2147483648, 1), 12345);
- text: <code>linearCongGenerator(0, 1103515245, 12345, 2147483648, 2)</code> should return <code>1406932606</code>.
testString: assert.equal(linearCongGenerator(0, 1103515245, 12345, 2147483648, 2), 1406932606, '<code>linearCongGenerator(0, 1103515245, 12345, 2147483648, 2)</code> should return <code>1406932606</code>.');
testString: assert.equal(linearCongGenerator(0, 1103515245, 12345, 2147483648, 2), 1406932606);
```
</section>

View File

@ -22,19 +22,19 @@ Write a function that takes two strings of large numbers as parameters. Your fun
``` yml
tests:
- text: <code>mult</code> should be a function.
testString: assert(typeof mult == 'function', '<code>mult</code> should be a function.');
testString: assert(typeof mult == 'function');
- text: <code>mult("18446744073709551616", "18446744073709551616")</code> should return a string.
testString: assert(typeof mult("18446744073709551616", "18446744073709551616") == 'string', '<code>mult("18446744073709551616", "18446744073709551616")</code> should return a string.');
testString: assert(typeof mult("18446744073709551616", "18446744073709551616") == 'string');
- text: <code>mult("18446744073709551616", "18446744073709551616")</code> should return <code>"340282366920938463463374607431768211456"</code>.
testString: assert.equal(mult("18446744073709551616", "18446744073709551616"), "340282366920938463463374607431768211456", '<code>mult("18446744073709551616", "18446744073709551616")</code> should return <code>"340282366920938463463374607431768211456"</code>.');
testString: assert.equal(mult("18446744073709551616", "18446744073709551616"), "340282366920938463463374607431768211456");
- text: <code>mult("31844674073709551616", "1844674407309551616")</code> should return <code>"58743055272886011737990786529368211456"</code>.
testString: assert.equal(mult("31844674073709551616", "1844674407309551616"), "58743055272886011737990786529368211456", '<code>mult("31844674073709551616", "1844674407309551616")</code> should return <code>"58743055272886011737990786529368211456"</code>.');
testString: assert.equal(mult("31844674073709551616", "1844674407309551616"), "58743055272886011737990786529368211456");
- text: <code>mult("1846744073709551616", "44844644073709551616")</code> should return <code>"82816580680737279241781007431768211456"</code>.
testString: assert.equal(mult("1846744073709551616", "44844644073709551616"), "82816580680737279241781007431768211456", '<code>mult("1846744073709551616", "44844644073709551616")</code> should return <code>"82816580680737279241781007431768211456"</code>.');
testString: assert.equal(mult("1846744073709551616", "44844644073709551616"), "82816580680737279241781007431768211456");
- text: <code>mult("1844674407370951616", "1844674407709551616")</code> should return <code>"3402823669833978308014392742590611456"</code>.
testString: assert.equal(mult("1844674407370951616", "1844674407709551616"), "3402823669833978308014392742590611456", '<code>mult("1844674407370951616", "1844674407709551616")</code> should return <code>"3402823669833978308014392742590611456"</code>.');
testString: assert.equal(mult("1844674407370951616", "1844674407709551616"), "3402823669833978308014392742590611456");
- text: <code>mult("2844674407370951616", "1844674407370955616")</code> should return <code>"5247498076580334548376218009219475456"</code>.
testString: assert.equal(mult("2844674407370951616", "1844674407370955616"), "5247498076580334548376218009219475456", '<code>mult("2844674407370951616", "1844674407370955616")</code> should return <code>"5247498076580334548376218009219475456"</code>.');
testString: assert.equal(mult("2844674407370951616", "1844674407370955616"), "5247498076580334548376218009219475456");
```
</section>