Skip to content

Sort seems to be unstable #4

@Spindletop

Description

@Spindletop

Calling the sort of an already sorted file leads to wrong output.

This can be tested e.g. by calling sortxml.exe c_sorted.xml or
sortxml.exe file1.xml > file2.xml && sortxml.exe file2.xml > file3.xml && sortxml.exe file3.xml > file4.xml. file1.xml and file3.xml match, and file2.xml and file4.xml match, i.e. output toggles.

input file (c_sorted.xml)

<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Author>Kody Brown</Author>
      <Description>Outputs: return false</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>rf</Shortcut>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>return false</Title>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[return false;$end$]]></Code>
    </Snippet>
  </CodeSnippet>
  <CodeSnippet Format="1.0.0">
    <Header>
      <Author>Kody Brown</Author>
      <Description>Outputs: Loc.GetText("")</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>ll</Shortcut>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
      <Title>locgettext</Title>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[Loc.GetText("$end$")]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

output file:

<?xml version="1.0" encoding="ibm850"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Author>Kody Brown</Author>
      <Description>Outputs: Loc.GetText("")</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>ll</Shortcut>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
      <Title>locgettext</Title>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[Loc.GetText("$end$")]]></Code>
    </Snippet>
  </CodeSnippet>
  <CodeSnippet Format="1.0.0">
    <Header>
      <Author>Kody Brown</Author>
      <Description>Outputs: return false</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>rf</Shortcut>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>return false</Title>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[return false;$end$]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

Program has been compiled with VS2012.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions