Skip to content

Commit 5921e53

Browse files
committed
refs #8: handle non-testable problems
Signed-off-by: Eric Wang <[email protected]>
1 parent 6d01dec commit 5921e53

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/commands/show.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cmd.handler = function(argv) {
5050
console.log(sprintf('* %s (%.2f%%)', problem.level, problem.percent));
5151
console.log(sprintf('* Total Accepted: %d', problem.totalAC));
5252
console.log(sprintf('* Total Submissions: %d', problem.totalSubmit));
53-
if (problem.testcase) {
53+
if (problem.testable && problem.testcase) {
5454
console.log(sprintf('* Testcase Example: %s',
5555
chalk.yellow(util.inspect(problem.testcase))));
5656
}

lib/commands/test.js

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ cmd.handler = function(argv) {
5555
core.getProblem(keyword, function(e, problem) {
5656
if (e) return console.log('ERROR:', e);
5757

58+
if (!problem.testable)
59+
return console.log('ERROR: not testable? please submit directly!');
60+
5861
if (testcase !== undefined)
5962
problem.testcase = testcase.replace(/\\n/g, '\n');
6063

lib/leetcode_client.js

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ leetcodeClient.getProblem = function(problem, cb) {
134134
var args = eval(raw);
135135
problem.templates = args[0];
136136
problem.testcase = args[8];
137+
problem.testable = args[10];
137138

138139
return cb(null, problem);
139140
});

0 commit comments

Comments
 (0)