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/GROOVY_2_5_X 4f7691eb4 -> 149abea2a


fix style-guide range example (closes #661)

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

(cherry picked from commit 9725b02)


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 149abea2a24a7f97039b27af4bf0906c74bd9f18
Parents: 4f7691e
Author: John J. Allison <[hidden email]>
Authored: Fri Feb 9 01:06:22 2018 +0800
Committer: sunlan <[hidden email]>
Committed: Fri Feb 9 10:23:06 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/149abea2/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*/
 

Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun