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_4_X dab55bd11 -> 2ee08f895


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

Branch: refs/heads/GROOVY_2_4_X
Commit: 2ee08f895f3719062809b89d0157556aed0a0405
Parents: dab55bd
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:33 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/2ee08f89/src/spec/doc/style-guide.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/style-guide.adoc b/src/spec/doc/style-guide.adoc
index e1a8a3f..baef245 100644
--- a/src/spec/doc/style-guide.adoc
+++ b/src/spec/doc/style-guide.adoc
@@ -473,9 +473,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*/