Skip to content

Commit 3a03a92

Browse files
committed
[Diff] Add some symbol tests
Unfortunately, line ranges (which start at BOL) cannot be tested.
1 parent 03488bb commit 3a03a92

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Diff/tests/syntax_test_diff.diff

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\ SYNTAX TEST "Packages/Diff/Diff.sublime-syntax"
1+
\ SYNTAX TEST partial-symbols "Packages/Diff/Diff.sublime-syntax"
22

33
--- Path to Original File
44
\^^^^^^^^^^^^^^^^^^^^^^^^ meta.diff.header.from-file meta.header.from-file.diff - source.diff.git
@@ -103,6 +103,7 @@ Plain Text
103103
\ ^^ markup.changed.diff meta.whitespace.trailing.diff
104104

105105
Index: lao
106+
\ @@@ local-definition
106107
\^^^^^^^^^^ meta.diff.index meta.index.diff
107108
\^^^^ meta.mapping.key.diff keyword.other.diff
108109
\ ^ punctuation.separator.key-value.diff
@@ -340,6 +341,7 @@ Diff3 Edit Format https://www.gnu.org/software/diffutils/manual/diffutils.html#S
340341

341342
SVN sample https://svnbook.red-bean.com/en/1.7/svn-book.html#idm10685
342343
Index: deleted-file
344+
\ @@@@@@@@@@@@ local-definition
343345
\^^^^^^^^^^^^^^^^^^ meta.mapping.diff meta.diff.index meta.index.diff
344346
\^^^^ meta.mapping.key.diff keyword.other.diff
345347
\ ^ punctuation.separator.key-value.diff
@@ -364,6 +366,7 @@ Index: deleted-file
364366
-This file will be deleted.
365367
\^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.deleted.diff
366368
Index: changed-file
369+
\ @@@@@@@@@@@@ local-definition
367370
\^^^^^^^^^^^^^^^^^^ meta.mapping.diff meta.diff.index meta.index.diff
368371
\^^^^ meta.mapping.key.diff keyword.other.diff
369372
\ ^ punctuation.separator.key-value.diff
@@ -390,6 +393,7 @@ Property changes on: changed-file
390393
___________________________________________________________________
391394
\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.separator.diff punctuation.separator.block.diff
392395
Added: propname
396+
\ @@@@@@@@ local-definition
393397
\^^^^^^^^^^^^^^ meta.mapping.diff meta.diff.index meta.index.diff
394398
\^^^^ meta.mapping.key.diff keyword.other.diff
395399
\ ^ punctuation.separator.key-value.diff
@@ -398,6 +402,7 @@ Added: propname
398402
+propvalue
399403
\^^^^^^^^^ markup.inserted.diff
400404
Index: added-file
405+
\ @@@@@@@@@@ local-definition
401406
===================================================================
402407
--- added-file (revision 0)
403408
+++ added-file (working copy)
@@ -407,6 +412,7 @@ Index: added-file
407412

408413
https://www.gnu.org/software/diffutils/manual/diffutils.html#Marking-Conflicts-1
409414
<<<<<<< A
415+
\ @ local-definition "Conflict: A"
410416
\^^^^^^^^^ meta.block.conflict.begin.diff - meta.block meta.block - markup
411417
\^^^^^^ punctuation.section.block.begin.diff
412418
\ ^ - entity - punctuation
@@ -429,6 +435,7 @@ context context
429435
\^^^^^^^^^^^^^^^ - meta.block
430436

431437
<<<<<<< A
438+
\ @ local-definition "Conflict: A"
432439
lines from A
433440
||||||| B
434441
\^^^^^^^^^ meta.block.conflict.separator.diff - meta.block meta.block - markup
@@ -453,12 +460,14 @@ context context
453460
\ <- - meta.block
454461

455462
<<<<<<< tzu
463+
\ @@@ local-definition "Conflict: tzu"
456464
=======
457465
The Way that can be told of is not the eternal Way;
458466
The name that can be named is not the eternal name.
459467
>>>>>>> tao
460468

461469
<<<<<<< lao
470+
\ @@@ local-definition "Conflict: lao"
462471
||||||| tzu
463472
They both may be called deep and profound.
464473
Deeper and more profound,
@@ -469,6 +478,7 @@ The door of all subtleties!
469478
>>>>>>> tao
470479

471480
<<<<<<< lao
481+
\ @@@ local-definition "Conflict: lao"
472482
=======
473483

474484
-- The Way of Lao-Tzu, tr. Wing-tsit Chan
@@ -477,6 +487,7 @@ The door of all subtleties!
477487

478488
https://www.gnu.org/software/diffutils/manual/diffutils.html#Generating-the-Merged-Output-Directly
479489
<<<<<<< tzu
490+
\ @@@ local-definition "Conflict: tzu"
480491
=======
481492
The Way that can be told of is not the eternal Way;
482493
The name that can be named is not the eternal name.
@@ -491,6 +502,7 @@ The two are the same,
491502
But after they are produced,
492503
they have different names.
493504
<<<<<<< lao
505+
\ @@@ local-definition "Conflict: lao"
494506
||||||| tzu
495507
They both may be called deep and profound.
496508
Deeper and more profound,
@@ -502,6 +514,7 @@ The door of all subtleties!
502514

503515
If you have questions, please
504516
<<<<<<< HEAD
517+
\ @@@@ local-definition "Conflict: HEAD"
505518
open an issue
506519
=======
507520
ask your question in IRC.
@@ -513,6 +526,7 @@ ask your question in IRC.
513526

514527
def hello
515528
<<<<<<< ours
529+
\ @@@@ local-definition "Conflict: ours"
516530
puts 'hola world'
517531
||||||| base
518532
puts 'hello world'
@@ -526,6 +540,7 @@ hello()
526540

527541
\ https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#_basic_merge_conflicts
528542
<<<<<<< HEAD:index.html
543+
\ @@@@@@@@@@@@@@@ local-definition "Conflict: HEAD:index.html"
529544
<div id="footer">contact : [email protected]</div>
530545
=======
531546
<div id="footer">
@@ -536,6 +551,7 @@ hello()
536551

537552
\ https://git-scm.com/docs/rerere.html#_nested_conflicts
538553
<<<<<<< HEAD
554+
\ @@@@ local-definition "Conflict: HEAD"
539555
\^^^^^^^^^^^^ meta.block.conflict.begin.diff
540556
\^^^^^^ punctuation.section.block.begin.diff
541557
\ ^^^^ entity.name.section.diff
@@ -545,6 +561,7 @@ hello()
545561
\^^^^^^^ meta.block.conflict.separator.diff
546562
\^^^^^^ punctuation.section.block.diff
547563
<<<<<<< HEAD
564+
\ @@@@ local-definition "Conflict: HEAD"
548565
\^^^^^^^^^^^^ meta.block.conflict.diff markup.inserted.diff meta.block.conflict.begin.diff
549566
\^^^^^^ punctuation.section.block.begin.diff
550567
\ ^^^^ entity.name.section.diff

Git Formats/tests/syntax_test_git_diff.patch

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\ SYNTAX TEST "Packages/Git Formats/Git Diff.sublime-syntax"
1+
\ SYNTAX TEST partial-symbols "Packages/Git Formats/Git Diff.sublime-syntax"
22
From 8f72bad1baf19a53459661343e21d6491c3908d3 Mon Sep 17 00:00:00 2001
33
\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.diff
44
\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant.other.hash.git
@@ -75,11 +75,13 @@ Much better, no?
7575

7676
---
7777
Gemfile | 1 +
78+
\@@@@@@@ local-definition
7879
\^^^^^^^ meta.toc-list.filename.diff meta.path.git string.unquoted.git
7980
\ ^ punctuation.separator.sequence.diff
8081
\ ^ meta.number.integer.decimal.diff constant.numeric.value.diff
8182
\ ^ markup.inserted.diff
8283
app/assets/images/logo.jpeg | Bin 0 -> 50966 bytes
84+
\@@@@@@@@@@@@@@@@@@@@@@@@@@@ local-definition
8385
\^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.toc-list.filename.diff meta.path.git string.unquoted.git
8486
\ ^ punctuation.separator.path.diff
8587
\ ^ punctuation.separator.path.diff
@@ -91,6 +93,7 @@ Much better, no?
9193
\ ^^^^^ meta.number.integer.decimal.diff constant.numeric.value.diff markup.inserted.diff
9294
\ ^^^^^ constant.numeric.suffix.diff
9395
fonts/icomoon.eot | Bin 55452 -> 56000 bytes
96+
\@@@@@@@@@@@@@@@@@ local-definition
9497
3 files changed, 1 insertion(+)
9598
\^ meta.number.integer.decimal.diff constant.numeric.value.diff
9699
\ ^ punctuation.separator.sequence.diff

0 commit comments

Comments
 (0)