Skip to content

Commit 4487808

Browse files
authored
checks: add an example (#1881)
1 parent cec47c1 commit 4487808

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

pkgs/checks/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.1.1-dev
2+
3+
- Added an example.
4+
15
# 0.1.0
26

37
- Initial release.

pkgs/checks/example/example.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'package:checks/checks.dart';
6+
import 'package:test/scaffolding.dart';
7+
8+
void main() {
9+
test('sample test', () {
10+
final someValue = 5;
11+
checkThat(someValue).equals(5);
12+
13+
final someList = [1, 2, 3, 4, 5];
14+
checkThat(someList).deepEquals([1, 2, 3, 4, 5]);
15+
16+
final someString = 'abcdefghijklmnopqrstuvwxyz';
17+
18+
checkThat(someString)
19+
..startsWith('a')
20+
..endsWith('z')
21+
..contains('lmno');
22+
});
23+
}

pkgs/checks/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: checks
2-
version: 0.1.0
2+
version: 0.1.1-dev
33
description: >-
44
A framework for checking values against expectations and building custom
55
expectations.

0 commit comments

Comments
 (0)