Skip to content

Commit 7d9cdb7

Browse files
committed
Refactor clipboard parser test case names for clarity and consistency
1 parent 75dad7f commit 7d9cdb7

63 files changed

Lines changed: 25 additions & 24 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/clipboard-parser.spec.ts‎

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('clipboard-parser', () => {
6565
})
6666

6767
it('parses file when using file-xml format with CDATA inside a markdown code block', () => {
68-
const test_case = 'file-xml-with-cdata-without-code-blocks'
68+
const test_case = 'file-xml-with-cdata-inside-code-block'
6969
const text = load_test_case_file(test_case, `${test_case}.txt`)
7070
const result = parse_multiple_files({
7171
response: text,
@@ -377,7 +377,7 @@ describe('clipboard-parser', () => {
377377

378378
describe('parse_response', () => {
379379
it('parses diff format without markdown code block or git header', () => {
380-
const test_case = 'diff-direct-variant-a'
380+
const test_case = 'diff-no-markdown-or-git-header'
381381
const text = load_test_case_file(test_case, `${test_case}.txt`)
382382
const result = parse_response({
383383
response: text,
@@ -413,7 +413,7 @@ describe('clipboard-parser', () => {
413413
})
414414

415415
it('parses diff format with git header but no markdown code block', () => {
416-
const test_case = 'diff-direct-variant-b'
416+
const test_case = 'diff-with-git-header-no-markdown'
417417
const text = load_test_case_file(test_case, `${test_case}.txt`)
418418
const result = parse_response({
419419
response: text,
@@ -429,7 +429,7 @@ describe('clipboard-parser', () => {
429429
})
430430

431431
it('parses diff format with git header but no ---/+++ lines', () => {
432-
const test_case = 'diff-direct-variant-c'
432+
const test_case = 'diff-with-git-header-no-file-lines'
433433
const text = load_test_case_file(test_case, `${test_case}.txt`)
434434
const result = parse_response({
435435
response: text,
@@ -445,7 +445,7 @@ describe('clipboard-parser', () => {
445445
})
446446

447447
it('parses diff format with git header and hunk header on same line', () => {
448-
const test_case = 'diff-direct-variant-d'
448+
const test_case = 'diff-git-and-hunk-header-same-line'
449449
const text = load_test_case_file(test_case, `${test_case}.txt`)
450450
const result = parse_response({
451451
response: text,
@@ -461,7 +461,7 @@ describe('clipboard-parser', () => {
461461
})
462462

463463
it('parses diff for a new file with git header', () => {
464-
const test_case = 'diff-direct-variant-e'
464+
const test_case = 'diff-new-file-with-git-header'
465465
const text = load_test_case_file(test_case, `${test_case}.txt`)
466466
const result = parse_response({
467467
response: text,
@@ -477,7 +477,7 @@ describe('clipboard-parser', () => {
477477
})
478478

479479
it('parses diff format with timestamps in ---/+++ lines', () => {
480-
const test_case = 'diff-direct-variant-f'
480+
const test_case = 'diff-with-timestamps'
481481
const text = load_test_case_file(test_case, `${test_case}.txt`)
482482
const result = parse_response({
483483
response: text,
@@ -493,7 +493,7 @@ describe('clipboard-parser', () => {
493493
})
494494

495495
it('parses diff format with quoted file paths in ---/+++ lines', () => {
496-
const test_case = 'diff-direct-variant-g'
496+
const test_case = 'diff-with-quoted-paths'
497497
const text = load_test_case_file(test_case, `${test_case}.txt`)
498498
const result = parse_response({
499499
response: text,
@@ -525,7 +525,7 @@ describe('clipboard-parser', () => {
525525
})
526526

527527
it('parses diff format for a file deletion', () => {
528-
const test_case = 'diff-direct-variant-deletion'
528+
const test_case = 'diff-file-deletion'
529529
const text = load_test_case_file(test_case, `${test_case}.txt`)
530530
const result = parse_response({
531531
response: text,
@@ -558,7 +558,7 @@ describe('clipboard-parser', () => {
558558
})
559559

560560
it('parses multiple diffs each in their own markdown code block', () => {
561-
const test_case = 'diff-multiple-files-variant-a'
561+
const test_case = 'diff-multiple-files-separate-markdown-blocks'
562562
const text = load_test_case_file(test_case, `${test_case}.txt`)
563563
const result = parse_response({
564564
response: text,
@@ -580,7 +580,8 @@ describe('clipboard-parser', () => {
580580
})
581581

582582
it('parses multiple diffs with git headers each in their own markdown code block', () => {
583-
const test_case = 'diff-multiple-files-variant-b'
583+
const test_case =
584+
'diff-multiple-files-with-git-headers-separate-markdown-blocks'
584585
const text = load_test_case_file(test_case, `${test_case}.txt`)
585586
const result = parse_response({
586587
response: text,
@@ -602,7 +603,7 @@ describe('clipboard-parser', () => {
602603
})
603604

604605
it('parses multiple diffs with git headers and no ---/+++ lines in markdown code blocks', () => {
605-
const test_case = 'diff-multiple-files-variant-c'
606+
const test_case = 'diff-multiple-files-with-git-headers-no-file-lines'
606607
const text = load_test_case_file(test_case, `${test_case}.txt`)
607608
const result = parse_response({
608609
response: text,
@@ -624,7 +625,7 @@ describe('clipboard-parser', () => {
624625
})
625626

626627
it('parses multiple diffs with hunk header on same line as git header in markdown code blocks', () => {
627-
const test_case = 'diff-multiple-files-variant-d'
628+
const test_case = 'diff-multiple-files-git-and-hunk-header-same-line'
628629
const text = load_test_case_file(test_case, `${test_case}.txt`)
629630
const result = parse_response({
630631
response: text,
@@ -646,7 +647,7 @@ describe('clipboard-parser', () => {
646647
})
647648

648649
it('parses multiple new file diffs in their own markdown code blocks', () => {
649-
const test_case = 'diff-multiple-files-variant-e'
650+
const test_case = 'diff-multiple-new-files-separate-markdown-blocks'
650651
const text = load_test_case_file(test_case, `${test_case}.txt`)
651652
const result = parse_response({
652653
response: text,
@@ -668,7 +669,7 @@ describe('clipboard-parser', () => {
668669
})
669670

670671
it('parses multiple diffs with timestamps in their own markdown code blocks', () => {
671-
const test_case = 'diff-multiple-files-variant-f'
672+
const test_case = 'diff-multiple-files-with-timestamps'
672673
const text = load_test_case_file(test_case, `${test_case}.txt`)
673674
const result = parse_response({
674675
response: text,
@@ -690,7 +691,7 @@ describe('clipboard-parser', () => {
690691
})
691692

692693
it('parses multiple diffs concatenated within a single markdown code block', () => {
693-
const test_case = 'diff-multiple-files-variant-g'
694+
const test_case = 'diff-multiple-files-single-markdown-block'
694695
const text = load_test_case_file(test_case, `${test_case}.txt`)
695696
const result = parse_response({
696697
response: text,
@@ -712,7 +713,7 @@ describe('clipboard-parser', () => {
712713
})
713714

714715
it('parses multiple diffs concatenated without a markdown code block', () => {
715-
const test_case = 'diff-multiple-files-variant-h'
716+
const test_case = 'diff-multiple-files-no-markdown-block'
716717
const text = load_test_case_file(test_case, `${test_case}.txt`)
717718
const result = parse_response({
718719
response: text,
@@ -734,7 +735,7 @@ describe('clipboard-parser', () => {
734735
})
735736

736737
it('parses multiple diffs with quoted file paths in separate markdown code blocks', () => {
737-
const test_case = 'diff-multiple-files-variant-i'
738+
const test_case = 'diff-multiple-files-with-quoted-paths'
738739
const text = load_test_case_file(test_case, `${test_case}.txt`)
739740
const result = parse_response({
740741
response: text,
@@ -756,7 +757,7 @@ describe('clipboard-parser', () => {
756757
})
757758

758759
it('parses multiple diffs without a/ b/ prefixes in a single markdown code block', () => {
759-
const test_case = 'diff-multiple-files-variant-j'
760+
const test_case = 'diff-multiple-files-no-prefix-single-markdown-block'
760761
const text = load_test_case_file(test_case, `${test_case}.txt`)
761762
const result = parse_response({
762763
response: text,
@@ -778,7 +779,7 @@ describe('clipboard-parser', () => {
778779
})
779780

780781
it('parses a mix of a new file in a code block and a diff in a diff block', () => {
781-
const test_case = 'diff-multiple-files-variant-k'
782+
const test_case = 'diff-mix-new-file-and-diff'
782783
const text = load_test_case_file(test_case, `${test_case}.txt`)
783784
const result = parse_response({
784785
response: text,
@@ -800,7 +801,7 @@ describe('clipboard-parser', () => {
800801
})
801802

802803
it('parses a mix of a new file in file-xml format and a diff in a diff block', () => {
803-
const test_case = 'diff-multiple-files-variant-l'
804+
const test_case = 'diff-mix-new-file-xml-and-diff'
804805
const text = load_test_case_file(test_case, `${test_case}.txt`)
805806
const result = parse_response({
806807
response: text,
@@ -822,7 +823,7 @@ describe('clipboard-parser', () => {
822823
})
823824

824825
it('parses a mix of a file deletion diff and a new file diff', () => {
825-
const test_case = 'diff-multiple-files-variant-m'
826+
const test_case = 'diff-mix-delete-and-new-file'
826827
const text = load_test_case_file(test_case, `${test_case}.txt`)
827828
const result = parse_response({
828829
response: text,
@@ -844,7 +845,7 @@ describe('clipboard-parser', () => {
844845
})
845846

846847
it('parses a mix of a new file from heading and code block, and a separate diff block', () => {
847-
const test_case = 'diff-multiple-files-variant-n'
848+
const test_case = 'diff-mix-new-file-from-heading-and-diff'
848849
const text = load_test_case_file(test_case, `${test_case}.txt`)
849850
const result = parse_response({
850851
response: text,
@@ -866,7 +867,7 @@ describe('clipboard-parser', () => {
866867
})
867868

868869
it('merges a new file and a diff for the same file path into one patch', () => {
869-
const test_case = 'diff-multiple-files-variant-o'
870+
const test_case = 'diff-merge-new-file-and-diff-same-path'
870871
const text = load_test_case_file(test_case, `${test_case}.txt`)
871872
const result = parse_response({
872873
response: text,

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-direct-variant-deletion/diff-direct-variant-deletion.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-file-deletion/diff-file-deletion.txt

File renamed without changes.

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-direct-variant-deletion/file-1.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-file-deletion/file-1.txt

File renamed without changes.

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-direct-variant-d/diff-direct-variant-d.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-git-and-hunk-header-same-line/diff-git-and-hunk-header-same-line.txt

File renamed without changes.

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-direct-variant-a/file-1.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-git-and-hunk-header-same-line/file-1.txt

File renamed without changes.

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-multiple-files-variant-o/diff-multiple-files-variant-o.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-merge-new-file-and-diff-same-path/diff-merge-new-file-and-diff-same-path.txt

File renamed without changes.

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-multiple-files-variant-o/file-1.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-merge-new-file-and-diff-same-path/file-1.txt

File renamed without changes.

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-multiple-files-variant-m/diff-multiple-files-variant-m.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-mix-delete-and-new-file/diff-mix-delete-and-new-file.txt

File renamed without changes.

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-multiple-files-variant-m/file-1.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-mix-delete-and-new-file/file-1.txt

File renamed without changes.

packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-multiple-files-variant-m/file-2.txt renamed to packages/vscode/src/commands/apply-chat-response-command/utils/clipboard-parser/test-cases/diff-mix-delete-and-new-file/file-2.txt

File renamed without changes.

0 commit comments

Comments
 (0)