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_6_X 2d60daf6f -> cd996ec19


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/cd996ec1
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/cd996ec1
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/cd996ec1

Branch: refs/heads/GROOVY_2_6_X
Commit: cd996ec1955eb0f6fbdf3c4bebe87b57fbbb1c1b
Parents: 2d60daf
Author: John J. Allison <[hidden email]>
Authored: Fri Feb 9 01:06:22 2018 +0800
Committer: sunlan <[hidden email]>
Committed: Fri Feb 9 10:22:42 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/cd996ec1/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