conformance library
The conformance suite of the db_dsl protocol.
Every engine of the protocol must pass it: MemoryEngine in db_dsl, the
native engines of flutter_local_db and dart_db, and any third-party
translator. The suite does not depend on a test framework; wrap each
case in your framework's test:
import 'package:db_dsl/conformance.dart';
import 'package:test/test.dart';
void main() {
final host = ConformanceHost(MyEngine(), () async => freshPath());
for (final ConformanceCase(:group, :name, :run) in Conformance.cases) {
test('$group: $name', () => run(host));
}
}
Classes
- Check
- Checks of the conformance cases.
- Conformance
- Every case of the suite.
- ConformanceCase
- One behavior an engine must show.
- ConformanceHost
- Opens fresh databases on the engine under test.
- ConformancePlatform
- What the platform running the suite can represent.
- JsonRow
- A row that is just its stored JSON, so cases can store any mix of kinds.
- ProtocolExample
- One exchange of the protocol: a request and what the engine answers.
- ProtocolExamples
-
The scenario of
PROTOCOL.md, in order: each request runs on the state the previous ones left.
Exceptions / Errors
- ConformanceFailure
- A conformance check that did not hold.