Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Aug 6, 2023
1 parent 2fc46bc commit a3f59ec
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Language: cs,
Value: <configSections/>,
Error: ,
FileLocation: path.cs(2-4),
FileLocation: path.cs(1-3),
IsInError: false
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Language: cs,
Value: b,
Error: ,
FileLocation: path.cs(4-6),
FileLocation: path.cs(3-5),
IsInError: false
},
{
Expand All @@ -15,7 +15,7 @@ a
b
c,
Error: ,
FileLocation: path.cs(2-8),
FileLocation: path.cs(1-7),
IsInError: false
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Language: cs,
Value: b,
Error: ,
FileLocation: path.cs(4-6),
FileLocation: path.cs(3-5),
IsInError: false
},
{
Expand All @@ -15,7 +15,7 @@ a
b
c,
Error: ,
FileLocation: path.cs(2-8),
FileLocation: path.cs(1-7),
IsInError: false
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Language: cs,
Value: b,
Error: ,
FileLocation: path.cs(4-6),
FileLocation: path.cs(3-5),
IsInError: false
},
{
Expand All @@ -15,7 +15,7 @@ a
b
c,
Error: ,
FileLocation: path.cs(2-8),
FileLocation: path.cs(1-7),
IsInError: false
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Language: cs,
Value: b,
Error: ,
FileLocation: path.cs(10-16),
FileLocation: path.cs(8-14),
IsInError: false
},
{
Expand All @@ -17,7 +17,7 @@ b

c,
Error: ,
FileLocation: path.cs(4-22),
FileLocation: path.cs(2-20),
IsInError: false
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
Key: codekey,
Error: Snippet was not closed,
FileLocation: path.cs(3-3),
FileLocation: path.cs(2-2),
IsInError: true
}
]
73 changes: 33 additions & 40 deletions src/Tests/SnippetExtractor/SnippetExtractorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,13 @@ public Task NestedRegion()
public Task NestedMixed2()
{
var input = """

#region KeyParent
a
<!-- begin-snippet: KeyChild -->
b
<!-- end-snippet -->
c
#endregion
#region KeyParent
a
<!-- begin-snippet: KeyChild -->
b
<!-- end-snippet -->
c
#endregion
""";
var snippets = FromText(input);
return Verify(snippets);
Expand All @@ -114,27 +113,25 @@ public Task RemoveDuplicateNewlines()
{
var input = """

<!-- begin-snippet: KeyParent -->


<!-- begin-snippet: KeyParent -->
a


a
<!-- begin-snippet: KeyChild -->


<!-- begin-snippet: KeyChild -->
b


b


<!-- end-snippet -->
<!-- end-snippet -->


c
c


<!-- end-snippet -->
<!-- end-snippet -->



Expand All @@ -147,14 +144,13 @@ public Task RemoveDuplicateNewlines()
public Task NestedStartCode()
{
var input = """

<!-- begin-snippet: KeyParent -->
a
<!-- begin-snippet: KeyChild -->
b
<!-- end-snippet -->
c
<!-- end-snippet -->
<!-- begin-snippet: KeyParent -->
a
<!-- begin-snippet: KeyChild -->
b
<!-- end-snippet -->
c
<!-- end-snippet -->
""";
var snippets = FromText(input);
return Verify(snippets);
Expand All @@ -164,14 +160,13 @@ public Task NestedStartCode()
public Task NestedMixed1()
{
var input = """

<!-- begin-snippet: KeyParent -->
a
#region KeyChild
b
#endregion
c
<!-- end-snippet -->
<!-- begin-snippet: KeyParent -->
a
#region KeyChild
b
#endregion
c
<!-- end-snippet -->
""";
var snippets = FromText(input);
return Verify(snippets);
Expand All @@ -181,10 +176,9 @@ public Task NestedMixed1()
public Task CanExtractFromXml()
{
var input = """

<!-- begin-snippet: CodeKey -->
<configSections/>
<!-- end-snippet -->
<!-- begin-snippet: CodeKey -->
<configSections/>
<!-- end-snippet -->
""";
var snippets = FromText(input);
return Verify(snippets);
Expand All @@ -200,9 +194,8 @@ static List<Snippet> FromText(string contents)
public Task UnClosedSnippet()
{
var input = """

<!-- begin-snippet: CodeKey -->
<configSections/>
<!-- begin-snippet: CodeKey -->
<configSections/>
""";
var snippets = FromText(input);
return Verify(snippets);
Expand Down

0 comments on commit a3f59ec

Please sign in to comment.