public ScriptEvaluator() { objectFormatter = CSharpObjectFormatter.Instance; printOptions = new PrintOptions { MaximumOutputLength = 114514, EscapeNonPrintableCharacters = true }; parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Script, languageVersion: LanguageVersion.Latest); }
internal static string ToDisplayString(this CSharpObjectFormatter csharpObjectFormatter, Exception ex) { var builder = new StringBuilder(); builder.Append(ex.GetType()); builder.Append(": "); builder.Append(csharpObjectFormatter.FormatException(ex)); return(builder.ToString()); }
public void ArrayOtInt32_NoMembers() { CSharpObjectFormatter formatter = CSharpObjectFormatter.Instance; object o = new int[4] { 3, 4, 5, 6 }; var str = formatter.FormatObject(o); Assert.Equal("int[4] { 3, 4, 5, 6 }", str); }
public PrettyPrinter() { this.objectFormatter = CSharpObjectFormatter.Instance; }