blob: 203f9709f428c72cc5800840bfcf1ad70211d121 [file] [log] [blame]
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// @assertion String indent
/// read-only
/// The string used for indention.
/// When generating multi-line output, this string is inserted once at the
/// beginning of each indented line for each level of indentation.
/// If null, the output is encoded as a single line.
/// @description Checks that this property returns the string used for indention.
/// @author
import "dart:convert";
import "../../../Utils/expect.dart";
main() {
JsonEncoder encoder = new JsonEncoder();
encoder = new JsonEncoder.withIndent(null);
encoder = new JsonEncoder.withIndent("");
Expect.equals("", encoder.indent);
encoder = new JsonEncoder.withIndent(" ");
Expect.equals(" ", encoder.indent);
encoder = new JsonEncoder.withIndent("--");
Expect.equals("--", encoder.indent);
encoder = new JsonEncoder.withIndent("Non-ASCII: отступ ");
Expect.equals("Non-ASCII: отступ ", encoder.indent);