blob: 2a355452c395ec49c2348840a8c6350d3d4486f5 [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 void sleep(Duration duration)
/// Sleep for the duration specified in [duration].
/// @description Checks that exception is thrown if [duration] is negative.
/// @author iarkh@unipro.ru
import "../../../Utils/expect.dart";
import "dart:io";
main(List<String> args) {
Duration dur = new Duration (milliseconds: -3);
Expect.throws(() { sleep(dur); }, (e) => e is ArgumentError);
}