blob: 4dbe2378d59c6f441ecf50fcd6f8b9f2718f58c6 [file] [log] [blame]
// Copyright (c) 2011, 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 final int millisecond
/// Returns the millisecond into the second 0...999.
/// @description Creates a new DateTime with various integer milliseconds values
/// (0..999),
/// and reads the value back.
/// @author hlodvig
import "../../../Utils/expect.dart";
main() {
for(int i = 999; i >= 0; --i){
check(i);
}
}
void check(int ms) {
DateTime date = new DateTime(2011, 1, 1, 0, 0, 0, ms);
Expect.isTrue(date.millisecond is int);
Expect.runtimeIsType<int>(date.millisecond);
Expect.equals(ms, date.millisecond);
}