8000 refs #8: handle non-testable problems · RoganSmith/leetcode-cli@5921e53 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5921e53

Browse files
committed
refs skygragon#8: handle non-testable problems
Signed-off-by: Eric Wang <skygragon@gmail.com>
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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)
0