Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Fix infinite loop on empty first key section (#360). #361

Closed
wants to merge 0 commits into from

Conversation

cesarblum
Copy link
Contributor

See #360.

The solution is to distinguish between root calls to ConfigurationRoot.GetChildrenImplementation() and subsequent recursive calls. So now passing null to that method signals this is a root call, whereas passing string.Empty means we're looking at a key section that has no name.

Assert.Equal(string.Empty, children.First().Key);
Assert.Equal(1, children.First().GetChildren().Count());
Assert.Equal("Key2", children.First().GetChildren().First().Key);
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend either making this a theory and add more cases, or adding more Facts to cover a few more scenarios:

  • :foo which you already cover
  • foo::bar
  • foo:
  • :foo::bar

etc.

@muratg
Copy link

muratg commented Dec 30, 2015

More tests, and :shipit:

@cesarblum cesarblum closed this Dec 30, 2015
@cesarblum cesarblum force-pushed the cesarbs/empty-key-infinite-loop branch from 0059ab5 to f4e4e53 Compare December 30, 2015 20:40
@cesarblum cesarblum deleted the cesarbs/empty-key-infinite-loop branch December 30, 2015 20:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants