void WriteIsVal(OrderedDictionary dic, string label, string key, List <PathEntry> path, int side) { var val = dic[key]; if (path == null || YAMLWriter.IsLeafType(val)) { Tw.WriteLine("#{0,11}: '{1}'", label, SafeToString(val)); } else { Tw.WriteLine("# {0}:", label); var yw = new YAMLWriter(Tw, 4, TAP.HorizontalThreshold, BBD); yw.Annotate = (i, n) => { return(GetAnnotation(i, n, path, side, 0)); }; yw.Write(val); } }
void WriteIsComment(OrderedDictionary dic, List <PathEntry> path) { bool leaf = path == null || (YAMLWriter.IsLeafType(dic["actual"]) && YAMLWriter.IsLeafType(dic["expected"])); if (!leaf) { Tw.WriteLine("actual not as expected"); } WriteIsVal(leaf, dic, "got", "actual", path, 0); if (leaf) { Tw.Write(" "); } WriteIsVal(leaf, dic, "expected", "expected", path, 1); if (leaf) { Tw.WriteLine(); } }
public override bool IsLeafType(object o, Type t) { return(YAMLWriter.IsLeafType(o, t)); }