blob: af2306b656f12d628b6a37ccd67e7025d19948a3 [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.
/// @assertion DateTime modified
/// final
/// The time of the last change to the data of the file system object.
/// @description Checks that this property returns the time of the last access to
/// the data of the file system object
/// @author
/// @issue 18442
import "dart:io";
import "../../../Utils/expect.dart";
import "../file_utils.dart";
main() async {
await inSandbox(_main);
_main(Directory sandbox) async {
File file = getTempFileSync(parent: sandbox);
await new Future.delayed(new Duration(seconds: 1));
await FileStat.stat(file.path).then((FileStat fs) async {
DateTime modified1 = fs.modified;
await file.writeAsBytes([1, 2, 3]).then((_) {
FileStat fs2 = FileStat.statSync(file.path);
Expect.isTrue(modified1.millisecondsSinceEpoch <