mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-14 16:36:18 -08:00
fix(jassub): [PKG-JASSUB-09] checkpoint hybrid canvas ownership and frame completion
This commit is contained in:
1 parent
b4b0276fe9
commit
7f185f698d
22 files changed
+18866
-37
No files matched your search
@@ -6,23 +6,26 @@ import test from 'node:test'
|
||||
import { hash } from './releases.mjs'
|
||||
|
||||
test('JASSUB local vendor patch retains its exact original, changed source and reversible patch identity', () => {
|
||||
const record = JSON.parse(fs.readFileSync('refactor/baselines/jassub-vendor-patch.json', 'utf8'))
|
||||
const original = execFileSync('git', ['show', `${record.baselineCommit}:${record.file}`], { encoding: 'utf8' }).replaceAll('\r\n', '\n')
|
||||
const followUp = JSON.parse(fs.readFileSync('refactor/baselines/jassub-offscreen-patch.json', 'utf8'))
|
||||
const current = execFileSync('git', ['show', `${followUp.baselineCommit}:${record.file}`], { encoding: 'utf8' }).replaceAll('\r\n', '\n')
|
||||
const patch = fs.readFileSync(record.patchFile, 'utf8').replaceAll('\r\n', '\n')
|
||||
assert.equal(hash(original), record.originalSha256LF)
|
||||
assert.equal(hash(current), record.patchedSha256LF)
|
||||
assert.equal(hash(patch), record.patchSha256LF)
|
||||
assert.notEqual(record.originalSha256LF, record.patchedSha256LF)
|
||||
const committedPatch = execFileSync('git', ['diff', '--no-ext-diff', record.baselineCommit, followUp.baselineCommit, '--', record.file], { encoding: 'utf8' }).replaceAll('\r\n', '\n')
|
||||
assert.equal(hash(committedPatch), record.patchSha256LF)
|
||||
assert.equal(followUp.originalSha256LF, record.patchedSha256LF)
|
||||
assert.equal(hash(fs.readFileSync(record.file, 'utf8').replaceAll('\r\n', '\n')), followUp.patchedSha256LF)
|
||||
assert.equal(hash(fs.readFileSync(followUp.patchFile, 'utf8').replaceAll('\r\n', '\n')), followUp.patchSha256LF)
|
||||
execFileSync('git', ['apply', '--check', '--reverse', '--ignore-space-change', followUp.patchFile], { stdio: 'pipe' })
|
||||
const records = ['vendor', 'offscreen', 'hybrid'].map(name => JSON.parse(fs.readFileSync(`refactor/baselines/jassub-${name}-patch.json`, 'utf8')))
|
||||
for (const [index, record] of records.entries()) {
|
||||
const next = records[index + 1]
|
||||
const original = execFileSync('git', ['show', `${record.baselineCommit}:${record.file}`], { encoding: 'utf8' }).replaceAll('\r\n', '\n')
|
||||
const current = (next ? execFileSync('git', ['show', `${next.baselineCommit}:${record.file}`], { encoding: 'utf8' }) : fs.readFileSync(record.file, 'utf8')).replaceAll('\r\n', '\n')
|
||||
assert.equal(hash(original), record.originalSha256LF)
|
||||
assert.equal(hash(current), record.patchedSha256LF)
|
||||
assert.equal(hash(fs.readFileSync(record.patchFile, 'utf8').replaceAll('\r\n', '\n')), record.patchSha256LF)
|
||||
assert.notEqual(record.originalSha256LF, record.patchedSha256LF)
|
||||
if (next) {
|
||||
assert.equal(next.originalSha256LF, record.patchedSha256LF)
|
||||
const committedPatch = execFileSync('git', ['diff', '--no-ext-diff', record.baselineCommit, next.baselineCommit, '--', record.file], { encoding: 'utf8' }).replaceAll('\r\n', '\n')
|
||||
assert.equal(hash(committedPatch), record.patchSha256LF)
|
||||
}
|
||||
else {
|
||||
execFileSync('git', ['apply', '--check', '--reverse', '--ignore-space-change', record.patchFile], { stdio: 'pipe' })
|
||||
}
|
||||
}
|
||||
const registry = JSON.parse(fs.readFileSync('refactor/third-party.json', 'utf8'))
|
||||
const group = registry.vendored.find(item => item.id === 'jassub-code-and-workers')
|
||||
assert.equal(group.localPatch.originalSha256LF, record.originalSha256LF)
|
||||
assert.equal(group.fingerprints.find(item => item.path === record.file).sha256, followUp.patchedSha256LF)
|
||||
assert.equal(group.localPatch.originalSha256LF, records[0].originalSha256LF)
|
||||
assert.equal(group.fingerprints.find(item => item.path === records[0].file).sha256, records.at(-1).patchedSha256LF)
|
||||
})
|
||||
Reference in new issue
Block a user