diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-28 15:15:48 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-28 15:15:48 +0000 |
commit | 8c5b60eb22d6d661e87992a65d54e3a5bc0aeed4 (patch) | |
tree | 7905b284cb5b3d62c17ad8a939e339621a498a2c /spec/ruby/language/fixtures | |
parent | 6530b14cee76e2512424d225e64d3c61dd1f6511 (diff) |
Update to ruby/spec@a6b8805
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/language/fixtures')
-rw-r--r-- | spec/ruby/language/fixtures/binary_symbol.rb | 4 | ||||
-rw-r--r-- | spec/ruby/language/fixtures/super.rb | 133 |
2 files changed, 118 insertions, 19 deletions
diff --git a/spec/ruby/language/fixtures/binary_symbol.rb b/spec/ruby/language/fixtures/binary_symbol.rb new file mode 100644 index 0000000000..2ddf565820 --- /dev/null +++ b/spec/ruby/language/fixtures/binary_symbol.rb @@ -0,0 +1,4 @@ +# encoding: binary + +p :il_était.to_s.bytes +puts :il_était.encoding.name diff --git a/spec/ruby/language/fixtures/super.rb b/spec/ruby/language/fixtures/super.rb index 4e89d59bed..09a454bdf4 100644 --- a/spec/ruby/language/fixtures/super.rb +++ b/spec/ruby/language/fixtures/super.rb @@ -478,20 +478,129 @@ module Super end end - module KeywordArguments - class A + module Keywords + class Arguments def foo(**args) args end end - class B < A - def foo(**) + # ---- + + class RequiredArguments < Arguments + def foo(a:) super end end - class C < A + class OptionalArguments < Arguments + def foo(b: 'b') + super + end + end + + class PlaceholderArguments < Arguments + def foo(**args) + super + end + end + + # ---- + + class RequiredAndOptionalArguments < Arguments + def foo(a:, b: 'b') + super + end + end + + class RequiredAndPlaceholderArguments < Arguments + def foo(a:, **args) + super + end + end + + class OptionalAndPlaceholderArguments < Arguments + def foo(b: 'b', **args) + super + end + end + + # ---- + + class RequiredAndOptionalAndPlaceholderArguments < Arguments + def foo(a:, b: 'b', **args) + super + end + end + end + + module RegularAndKeywords + class Arguments + def foo(a, **options) + [a, options] + end + end + + # ----- + + class RequiredArguments < Arguments + def foo(a, b:) + super + end + end + + class OptionalArguments < Arguments + def foo(a, c: 'c') + super + end + end + + class PlaceholderArguments < Arguments + def foo(a, **options) + super + end + end + + # ----- + + class RequiredAndOptionalArguments < Arguments + def foo(a, b:, c: 'c') + super + end + end + + class RequiredAndPlaceholderArguments < Arguments + def foo(a, b:, **options) + super + end + end + + class OptionalAndPlaceholderArguments < Arguments + def foo(a, c: 'c', **options) + super + end + end + + # ----- + + class RequiredAndOptionalAndPlaceholderArguments < Arguments + def foo(a, b:, c: 'c', **options) + super + end + end + end + + module SplatAndKeywords + class Arguments + def foo(*args, **options) + [args, options] + end + end + + class AllArguments < Arguments + def foo(*args, **options) + super + end end end @@ -552,18 +661,4 @@ module Super end end end - - module SplatAndKeyword - class A - def foo(*args, **options) - [args, options] - end - end - - class B < A - def foo(*args, **options) - super - end - end - end end |