Skip to content

Commit

Permalink
added the tests to cover Pair
Browse files Browse the repository at this point in the history
  • Loading branch information
featzima committed Feb 18, 2021
1 parent 5cf44c4 commit 6f0e8b5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .packages
Expand Up @@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-02-18 11:54:09.139925.
# Generated by pub on 2021-02-18 13:57:27.938326.
_fe_analyzer_shared:file:///Users/featzima/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-16.0.0/lib/
analyzer:file:///Users/featzima/.pub-cache/hosted/pub.dartlang.org/analyzer-1.0.0/lib/
args:file:///Users/featzima/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,11 @@
## 1.1.3

* Added the tests to cover Pair

## 1.1.2

* Updated the Travis and Coveralls badges

## 1.1.1

* Added the static analyzer rules
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,6 +1,6 @@
name: ktx
description: The KTX Library provides a comprehensive set of tools for managing collections.
version: 1.1.1-nullsafety
version: 1.1.3-nullsafety
author: Dmytro Glynskyi <dmytro.glynskyi@gmail.com>
homepage: https://github.com/glynskyi/ktx

Expand Down
18 changes: 18 additions & 0 deletions test/ktx_test.dart
Expand Up @@ -80,6 +80,24 @@ void main() {
expect(age.second, null);
});

test('compares two Pairs', () {
final age1 = Pair("age", 42);
final age2 = Pair("age", 42);
expect(age1, age2);
});

test('prints Pairs', () {
final age = Pair("age", 42);
expect(age.toString(), "(age, 42)");
});

test('uses map to store Pairs', () {
final age1 = Pair("age", 42);
final age2 = Pair("age", 48);
final map = {age1: "person1", age2: "person2"};
expect(map[age1], "person1");
});

test('zips to lists into one', () {
final kinds = ["Apple", "Pear", "Apricot"];
final colors = ["Red", "Green", "Orange"];
Expand Down

0 comments on commit 6f0e8b5

Please sign in to comment.