﻿using System.Linq;
using System.Text;
using NUnit.Framework;

namespace ValveKeyValue.Test
{
    class CommentOnEndOfTheLine
    {
        [Test]
        public void CanHandleCommentOnEndOfTheLine()
        {
            var text = new StringBuilder();
            text.AppendLine(@"""test_kv""");
            text.AppendLine("{");
            text.AppendLine("//");
            text.AppendLine(@"""test""	""hello""");
            text.AppendLine("}");

            var data = KVSerializer.Create(KVSerializationFormat.KeyValues1Text).Deserialize(text.ToString());

            Assert.Multiple(() =>
            {
                Assert.That(data.Children.Count(), Is.EqualTo(1));
                Assert.That((string)data["test"], Is.EqualTo("hello"));
            });
        }
    }
}

﻿using System.Linq;
using System.Text;
using NUnit.Framework;

namespace ValveKeyValue.Test
{
    class CommentOnEndOfTheLine
    {
        [Test]
        public void CanHandleCommentOnEndOfTheLine()
        {
            var text = new StringBuilder();
            text.Append(@"""test_kv""" + "\n");
            text.Append("{" + "\n");
            text.Append("//" + "\n");
            text.Append(@"""test""	""hello""" + "\n");
            text.Append("}" + "\n");

            var data = KVSerializer.Create(KVSerializationFormat.KeyValues1Text).Deserialize(text.ToString());

            Assert.Multiple(() =>
            {
                Assert.That(data.Children.Count(), Is.EqualTo(1));
                Assert.That((string)data["test"], Is.EqualTo("hello"));
            });
        }
    }
}

Improve the test in regards to \r\n
Improve the test in regards to \r\n
