Skip to content

Commit

Permalink
Add test that ensures current tab-based behavior
Browse files Browse the repository at this point in the history
To ensure compatibility with git config.

Closes #122
  • Loading branch information
kzu committed Jun 25, 2024
1 parent d6bd678 commit 30aa5b2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Config.Tests/ConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,19 @@ public void can_roundtrip()
Assert.Equal("bar", value);
}

[Fact]
public void when_setting_variable_then_uses_tab()
{
var file = Path.GetTempFileName();
var config = Config.Build(file);

config.SetString("section", "subsection", "foo", "bar");

var line = File.ReadAllLines(file).SkipWhile(x => x[0] == '#' || x[0] == '[').First();

Assert.Equal('\t', line[0]);
}

[Fact]
public void when_setting_global_variable_then_writes_global_file()
{
Expand Down

0 comments on commit 30aa5b2

Please sign in to comment.