Repository navigation
fix(diagnostic): launch the renamed feedBack-diagnostic pack #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JohanStolk
wants to merge
4
commits into
got-feedBack:main
Choose a base branch
from
JohanStolk:fix/diagnostic-track-rename
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
36034b2
fix(diagnostic): launch the renamed feedBack-diagnostic pack
5501f43
fix(diagnostic): match only the two real diagnostic pack names
988e957
fix(diagnostic): compare the exact pack basename
17d0f43
fix(diagnostic): one exact-basename rule for diagnostic filenames
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // The built-in calibration pack was renamed in core from | ||
| // slopsmith-diagnostic-basic-guitar.sloppak to feedBack-diagnostic-… (core | ||
| // #900). Both names must still be recognised as the diagnostic track, with the | ||
| // case-insensitive match the library's filenames need. | ||
| const { test } = require('node:test'); | ||
| const assert = require('node:assert'); | ||
| const fs = require('node:fs'); | ||
| const path = require('node:path'); | ||
| const { loadDetectionCore } = require('./_loader'); | ||
|
|
||
| const { filenameLooksDiagnostic, trackMatchesFilename } = loadDetectionCore(); | ||
|
|
||
| test('current core name (feedBack-…) is a diagnostic track', () => { | ||
| assert.strictEqual( | ||
| filenameLooksDiagnostic('diagnostics-builtin/feedBack-diagnostic-basic-guitar.sloppak'), true); | ||
| }); | ||
|
|
||
| test('legacy name (slopsmith-…) is still a diagnostic track', () => { | ||
| assert.strictEqual( | ||
| filenameLooksDiagnostic('diagnostics-builtin/slopsmith-diagnostic-basic-guitar.sloppak'), true); | ||
| }); | ||
|
|
||
| test('ordinary songs are not diagnostic tracks', () => { | ||
| assert.strictEqual(filenameLooksDiagnostic('Uriah Heep - Shadows Of Grief.feedpak'), false); | ||
| assert.strictEqual(filenameLooksDiagnostic(''), false); | ||
| assert.strictEqual(filenameLooksDiagnostic(null), false); | ||
| // Look-alikes are not the diagnostic pack (same rule as the catalog match). | ||
| assert.strictEqual(filenameLooksDiagnostic('my-feedBack-diagnostic-basic-guitar.sloppak'), false); | ||
| assert.strictEqual(filenameLooksDiagnostic('feedBack-diagnostic-basic-guitar.sloppak.bak'), false); | ||
| }); | ||
|
|
||
| test('the launcher points at the pack core seeds today', () => { | ||
| const src = fs.readFileSync(path.join(__dirname, '..', 'screen.js'), 'utf8'); | ||
| assert.match(src, | ||
| /dlcRelativePath: 'diagnostics-builtin\/feedBack-diagnostic-basic-guitar\.sloppak'/); | ||
| }); | ||
|
|
||
| test('the catalog matches only the two real pack names, not any similar suffix', () => { | ||
| const track = { filenameIncludes: ['feedback-diagnostic-basic-guitar.sloppak', | ||
| 'slopsmith-diagnostic-basic-guitar.sloppak'] }; | ||
| assert.strictEqual(trackMatchesFilename(track, | ||
| 'diagnostics-builtin/feedback-diagnostic-basic-guitar.sloppak'), true); | ||
| assert.strictEqual(trackMatchesFilename(track, | ||
| 'diagnostics-builtin/slopsmith-diagnostic-basic-guitar.sloppak'), true); | ||
| assert.strictEqual(trackMatchesFilename(track, 'my-own-diagnostic-basic-guitar.sloppak'), false); | ||
| assert.strictEqual(trackMatchesFilename(track, 'my-feedback-diagnostic-basic-guitar.sloppak'), false); | ||
| assert.strictEqual(trackMatchesFilename(track, 'feedback-diagnostic-basic-guitar.sloppak'), true); | ||
| assert.strictEqual(trackMatchesFilename(track, 'sub\\dir\\slopsmith-diagnostic-basic-guitar.sloppak'), true); | ||
| assert.strictEqual(trackMatchesFilename(track, ''), false); | ||
| assert.strictEqual(trackMatchesFilename({ filenameIncludes: 'x.sloppak' }, 'a/x.sloppak'), true); | ||
| }); | ||
|
|
||
| test('the catalog entry reuses the two filename markers', () => { | ||
| const src = fs.readFileSync(path.join(__dirname, '..', 'screen.js'), 'utf8'); | ||
| assert.match(src, /filenameIncludes: _ND_DIAGNOSTIC_FILENAME_MARKERS,/); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.