mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-20 23:25:43 +01:00
Answer product-owner round 1: 1 🔴, 5 🟡 (0 misread); add the licence notice, link each document to its page, stop a failed fetch reaching the corpus, keep raw folders out of the repo
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import { test } from 'node:test'
|
||||
|
||||
const repo = new URL('..', import.meta.url).pathname
|
||||
|
||||
function run(...args) {
|
||||
return spawnSync('sh', ['corpus-gathering/run.sh', ...args], { cwd: repo, encoding: 'utf8' })
|
||||
}
|
||||
|
||||
test('refuses a raw folder inside the repo', () => {
|
||||
const { status, stderr } = run('corpus')
|
||||
assert.equal(status, 2)
|
||||
assert.match(stderr, /outside the repo/)
|
||||
})
|
||||
|
||||
test('refuses the repo itself as the raw folder', () => {
|
||||
assert.equal(run('.').status, 2)
|
||||
})
|
||||
|
||||
test('names its argument when it is missing', () => {
|
||||
const { status, stderr } = run()
|
||||
assert.equal(status, 2)
|
||||
assert.match(stderr, /Usage: corpus-gathering\/run\.sh <raw folder>/)
|
||||
})
|
||||
Reference in New Issue
Block a user