Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

XML file code sample #63

Merged
merged 3 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/analyzer/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func TestMatchingFiles(t *testing.T) {
Extension: ".html",
Language: "HTML",
},
{
FilePath: filepath.Join(codeSamplesDir, "index.xml"),
Extension: ".xml",
Language: "XML",
},
{
FilePath: filepath.Join(codeSamplesDir, "main.go"),
Extension: ".go",
Expand Down Expand Up @@ -149,6 +154,11 @@ func TestMatchingFiles(t *testing.T) {
Extension: ".html",
Language: "HTML",
},
{
FilePath: filepath.Join(codeSamplesDir, "index.xml"),
Extension: ".xml",
Language: "XML",
},
{
FilePath: filepath.Join(codeSamplesDir, "main.js"),
Extension: ".js",
Expand Down Expand Up @@ -232,6 +242,11 @@ func TestMatchingFiles(t *testing.T) {
Extension: ".html",
Language: "HTML",
},
{
FilePath: filepath.Join(codeSamplesDir, "index.xml"),
Extension: ".xml",
Language: "XML",
},
{
FilePath: filepath.Join(codeSamplesDir, "main.js"),
Extension: ".js",
Expand Down
40 changes: 40 additions & 0 deletions test/fixtures/code_samples/index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<Catalog>
<Product description="Cardigan Sweater" productImage="cardigan.jpg">
<!-- Men's catalog -->
<CatalogItem gender="Men's" itemNumber="QWZ5671">
<Price>39.95</Price>
<Size description="Medium">
<ColorSwatch image="red_cardigan.jpg">Red</ColorSwatch>
<ColorSwatch image="burgundy_cardigan.jpg">Burgundy</ColorSwatch>
</Size>
<Size description="Large">
<ColorSwatch image="red_cardigan.jpg">Red</ColorSwatch>
<ColorSwatch image="burgundy_cardigan.jpg">Burgundy</ColorSwatch>
</Size>
</CatalogItem>
<!-- Women's catalog -->
<CatalogItem gender="Women's" itemNumber="RRX9856">
<Price>42.50</Price>
<Size description="Small">
<ColorSwatch image="red_cardigan.jpg">Red</ColorSwatch>
<ColorSwatch image="navy_cardigan.jpg">Navy</ColorSwatch>
<ColorSwatch image="burgundy_cardigan.jpg">Burgundy</ColorSwatch>
</Size>
<Size description="Medium">
<ColorSwatch image="red_cardigan.jpg">Red</ColorSwatch>
<ColorSwatch image="navy_cardigan.jpg">Navy</ColorSwatch>
<ColorSwatch image="burgundy_cardigan.jpg">Burgundy</ColorSwatch>
<ColorSwatch image="black_cardigan.jpg">Black</ColorSwatch>
</Size>
<Size description="Large">
<ColorSwatch image="navy_cardigan.jpg">Navy</ColorSwatch>
<ColorSwatch image="black_cardigan.jpg">Black</ColorSwatch>
</Size>
<Size description="Extra Large">
<ColorSwatch image="burgundy_cardigan.jpg">Burgundy</ColorSwatch>
<ColorSwatch image="black_cardigan.jpg">Black</ColorSwatch>
</Size>
</CatalogItem>
</Product>
</Catalog>