Skip to content

Commit 12b2685

Browse files
committed
Add failing test for #26; Values can't start with a slash
1 parent 1bb7f65 commit 12b2685

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Utility.CommandLine.Arguments.Tests/Arguments.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,18 @@ public void ParseStringOfLongs()
459459
Assert.Equal("5 5", test["five"]);
460460
}
461461

462+
/// <summary>
463+
/// Tests the <see cref="Utility.CommandLine.Arguments.Parse(string)"/> method with an explicit command line string
464+
/// containing a value beginning with a slash.
465+
/// </summary>
466+
[Fact]
467+
public void ParseValueBeginningWithSlash()
468+
{
469+
Dictionary<string, object> test = CommandLine.Arguments.Parse("--file=/mnt/data/test.xml").ArgumentDictionary;
470+
471+
Assert.Equal("/mnt/data/test.xml", test["file"]);
472+
}
473+
462474
/// <summary>
463475
/// Tests the <see cref="Utility.CommandLine.Arguments.Parse(string)"/> method with an explicit command line string
464476
/// containing arguments with values enclosed in quotes and containing a period.

0 commit comments

Comments
 (0)