blob: 5a2f5f76b3086cfc4c0bcd861ed96c379e0c8cf8 [file] [log] [blame]
// Copyright (c) 2017, 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.
// @dart = 2.9
/// @assertion bool hasTerminal
/// Returns true if there is a terminal attached to stdout.
/// @description Checks [hasTerminal] property correctness for [stderr].
/// @author iarkh@unipro.ru
import "dart:io";
import "../../../Utils/expect.dart";
main() {
if (stderr.hasTerminal) {
Expect.notEquals(0, stderr.terminalColumns);
Expect.notEquals(0, stderr.terminalLines);
} else {
Expect.throws(() => stderr.terminalColumns, (e) => e is StdoutException);
Expect.throws(() => stderr.terminalLines, (e) => e is StdoutException);
}
}