tested 1.0.0-alpha.2 copy "tested: ^1.0.0-alpha.2" to clipboard
tested: ^1.0.0-alpha.2 copied to clipboard

A testing library based on package:test

example/tested_example.dart

import 'package:tested/tested.dart';

int goodAdd(int a, int b) {
  return a + b;
}

int badAdd(int a, int b) {
  return a * b;
}

TestCase addTestCase(int Function(int, int) addFunc, List<int> c) =>
    expectTestCase(() => addFunc(c[0], c[1]), c[2]);

void main() {
  const cases = [
    [1, 2, 3],
    [40, 2, 42],
    [-1, -12, -13],
  ];
  tests(cases.map((c) => addTestCase(goodAdd, c)), 'good'); // doesn't fail
  tests(cases.map((c) => addTestCase(badAdd, c)), 'bad'); // fails
}
0
likes
0
pub points
7%
popularity

Publisher

verified publisherampless.chrissx.de

A testing library based on package:test

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

lints, meta, test

More

Packages that depend on tested