Skip to content

Commit aff33a4

Browse files
Run all the tests successfully
1 parent 142a6a4 commit aff33a4

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

LeetcodeProblems/Regular_Expression_Matching.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ var canBeZero = function(pattern, posPat) {
9090
return posPat == pattern.length;
9191
}
9292

93-
module.exports.isMatch = isM.isMatch;
93+
module.exports.isMatch = isMatch;

Main.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
const fs = require('fs');
22

3-
const PROBLEMS_FOLDER = './LeetcodeProblems/';
3+
const TESTS_FOLDER = './LeetcodeProblemsTests/';
44
const REGEX_PATTERN_HIDDEN_FILES = /(^|\/)\.[^\/\.]/g;
55

66
var main = async function() {
77
try {
88
const problems = await loadProblems();
9-
for(i in problems) {
10-
console.log("Solving: " + problems[i] + ":");
11-
const problem = require(PROBLEMS_FOLDER + problems[i]);
9+
for(i in problems) {
10+
console.log("Solving: " + problems[i]);
11+
const problem = require(TESTS_FOLDER + problems[i]);
1212

13-
if (typeof(problem.main) !=='undefined') {
14-
problem.main();
15-
console.log("End of the solution for : " + problems[i] + ",\n\n");
13+
if (typeof(problem.test) !=='undefined') {
14+
problem.test();
15+
console.log("End of the solution for : " + problems[i] + " \n\n");
1616
} else {
17-
console.warn(problem, "The problem " + problems[i] + " doesn't have a main method implemented.");
17+
console.warn(problem, "The problem " + problems[i] + " doesn't have a test method implemented.");
1818
}
1919
}
2020
} catch (error) {
@@ -24,7 +24,7 @@ var main = async function() {
2424

2525
var loadProblems = () => {
2626
return new Promise(function (resolve, reject) {
27-
fs.readdir(PROBLEMS_FOLDER, (error, files) => {
27+
fs.readdir(TESTS_FOLDER, (error, files) => {
2828
if (error) {
2929
reject(error);
3030
} else {

0 commit comments

Comments
 (0)