Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Sort seems to be unstable #4

Open
Spindletop opened this issue Apr 26, 2017 · 0 comments
Open

Sort seems to be unstable #4

Spindletop opened this issue Apr 26, 2017 · 0 comments

Comments

@Spindletop
Copy link

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.

zanaptak added a commit to zanaptak/sortxml that referenced this issue Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant