Skip to content

Commit

Permalink
feat: create testcase with empty input or output
Browse files Browse the repository at this point in the history
  • Loading branch information
luoingly committed Dec 3, 2024
1 parent afa6689 commit 2cd0821
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controllers/testcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const create = async (ctx) => {
const testin = ctx.request.body.in || ''
// 输出
const testout = ctx.request.body.out || ''

if (!testin && !testout) {
ctx.throw(400, 'Cannot create testcase without both input and output')
}

const testDir = path.resolve(__dirname, `../data/${pid}`)
const id = uuid() // 快速生成RFC4122 UUID
// 将文件读取到meta对象
Expand Down

0 comments on commit 2cd0821

Please sign in to comment.