groovy git commit: fix style-guide range example (closes #661)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: fix style-guide range example (closes #661)

Daniel.Sun
Repository: groovy
Updated Branches:
  refs/heads/master 05866b3ac -> 9725b02ce


fix style-guide range example (closes #661)

e674d77 added more information about ranges
but included erroneous code for range.size().


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/9725b02c
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/9725b02c
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/9725b02c

Branch: refs/heads/master
Commit: 9725b02ce04eb445c293b76ba1219271a84ad18e
Parents: 05866b3
Author: John J. Allison <[hidden email]>
Authored: Thu Feb 8 10:06:22 2018 -0700
Committer: sunlan <[hidden email]>
Committed: Fri Feb 9 10:20:24 2018 +0800

----------------------------------------------------------------------
 src/spec/doc/style-guide.adoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/9725b02c/src/spec/doc/style-guide.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/style-guide.adoc b/src/spec/doc/style-guide.adoc
index 2ee13cc..9b0cfd8 100644
--- a/src/spec/doc/style-guide.adoc
+++ b/src/spec/doc/style-guide.adoc
@@ -494,9 +494,9 @@ def map = [CA: 'California', MI: 'Michigan']
 
 // ranges can be inclusive and exclusive
 def range = 10..20 // inclusive
-assert range.size() == 21
+assert range.size() == 11
 // use brackets if you need to call a method on a range definition
-assert (10..<20).size() == 20 // exclusive
+assert (10..<20).size() == 10 // exclusive
 
 def pattern = ~/fo*/