blob: 38131efe63d5eee3e75d64687a43078f9bed06c9 [file] [log] [blame]
// Copyright (c) 2016, 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 ArgumentError.value(value, [ String name, String message ])
/// Creates error containing the invalid value.
/// @description Checks that this constructor executes without error for various
/// value, name and message arguments
/// @author
import "../../../Utils/expect.dart";
class C {
void check(var value, String? name, String? message) {
ArgumentError err = new ArgumentError.value(value, name, message);
Expect.equals(value, err.invalidValue);
Expect.equals(message, err.message);
main() {
check(null, "", "message");
check("", "name", "message");
check("foo", "bar", "");
check(true, "some name", null);
check(5, null, "not null");
check(new C(), "123", "456");
check(3.14, "Pi", "e");