commit | f289ad5967515ff8a26012de5d5cc996e5619808 | [log] [tgz] |
---|---|---|
author | Todd Volkert <tvolkert@users.noreply.github.com> | Tue Dec 13 13:43:07 2016 -0800 |
committer | GitHub <noreply@github.com> | Tue Dec 13 13:43:07 2016 -0800 |
tree | 0eb4b907ec3f57ce0a6175ee42eedebf53305743 | |
parent | 653c2fdc996ba31f35c0e1dbfb0eb53959aab408 [diff] |
Move memory tests to common tests. (#17) Move memory tests to common tests. This change prepares us to be able to run all file system tests against multiple implementations of the interface. The goal is to be able to test the local file system impl against all tests, and run the exact same tests against the in-memory impl, thus ensuring (a) the in-memory impl has test coverage, and (b) that it behaves identical in its API to the local dart:io variant. This change does not touch any code - just restructures things.
A generic file system abstraction for Dart.
This package is currently experimental and subject to change
Like dart:io
, package:file
supplies a rich Dart-idiomatic API for accessing a file system.
Unlike dart:io
, package:file
:
Implement your own custom file system:
import 'package:file/file.dart'; class FooBarFileSystem implements FileSystem { ... }
Use the in-memory file system:
import 'package:file/file.dart'; var fs = new InMemoryFileSystem();
Use the local file system (requires dart:io access):
import 'package:file/io.dart'; var fs = const LocalFileSystem();
The synchronous counterparts can be imported from:
// API and in-memory implementation import `package:file/sync.dart`; // Implementation based on "dart:io" import `package:file/sync_io.dart`;