public void TestStringLiteral() { Assert.AreEqual("\"\"", ZincPrintUtils.StringLiteral(string.Empty)); Assert.AreEqual("\"a\"", ZincPrintUtils.StringLiteral("a")); Assert.AreEqual("\"aa\"", ZincPrintUtils.StringLiteral("aa")); Assert.AreEqual("\"abb\"", ZincPrintUtils.StringLiteral("abb")); Assert.AreEqual("\"\\\"abb\\\"\"", ZincPrintUtils.StringLiteral("\"abb\"")); }
/// <summary> /// Returns a <see cref="System.String"/> that represents the current <see cref="ZincIncludeItem"/>. /// </summary> /// <returns>A <see cref="System.String"/> that represents the current <see cref="ZincIncludeItem"/>.</returns> /// <remarks> /// <para>The format of this method is <c>include "name"</c> where the name is the name of the included zinc file.</para> /// </remarks> public override string ToString() { return(string.Format("include {0}", ZincPrintUtils.StringLiteral(this.Name))); }