diff --git a/.idea/runConfigurations/All_Tests.xml b/.idea/runConfigurations/All_Tests.xml new file mode 100644 index 00000000..bdb678e2 --- /dev/null +++ b/.idea/runConfigurations/All_Tests.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index 47d1a526..89422ded 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # paginate [![version 1.0.0](https://img.shields.io/badge/pub-v1.0.0-brightgreen.svg)](https://pub.dartlang.org/packages/angel_paginate) [![build status](https://travis-ci.org/angel-dart/paginate.svg)](https://travis-ci.org/angel-dart/paginate) +![coverage: 97%](https://img.shields.io/badge/coverage-97%25-green.svg) Platform-agnostic pagination library, with custom support for the [Angel framework](https://github.com/angel-dart/angel). @@ -48,7 +49,7 @@ main() { print(page.startIndex); print(page.data); // The actual items on this page. p.next(); // Advance a page - p.goBack(); // Back one page + p.back(); // Back one page p.goToPage(10); // Go to page number (1-based, not a 0-based index) } ``` diff --git a/test/all_test.dart b/test/all_test.dart new file mode 100644 index 00000000..3669a2fc --- /dev/null +++ b/test/all_test.dart @@ -0,0 +1,7 @@ +import 'paginate_test.dart' as paginate_test; +import 'server_test.dart' as server; + +main() { + paginate_test.main(); + server.main(); +} \ No newline at end of file diff --git a/test/paginate_test.dart b/test/paginate_test.dart index 6c94dc93..fc85b3d2 100644 --- a/test/paginate_test.dart +++ b/test/paginate_test.dart @@ -43,6 +43,11 @@ main() { expect(paginator.canGoBack, false); expect(paginator.canGoForward, true); expect(paginator.lastPageNumber, 21); + + // Going back should do nothing + var p = paginator.pageNumber; + paginator.back(); + expect(paginator.pageNumber, p); }); group('paginate', () {