summaryrefslogtreecommitdiff
path: root/test/prism/fixtures/unparser/corpus/literal/def.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/prism/fixtures/unparser/corpus/literal/def.txt')
-rw-r--r--test/prism/fixtures/unparser/corpus/literal/def.txt134
1 files changed, 134 insertions, 0 deletions
diff --git a/test/prism/fixtures/unparser/corpus/literal/def.txt b/test/prism/fixtures/unparser/corpus/literal/def.txt
new file mode 100644
index 0000000000..61339bd4a6
--- /dev/null
+++ b/test/prism/fixtures/unparser/corpus/literal/def.txt
@@ -0,0 +1,134 @@
+def foo
+ a
+rescue
+ b
+else
+ c
+ensure
+ d
+end
+
+def foo
+ a rescue b
+rescue
+ b
+else
+ c
+ensure
+ d
+end
+
+def foo(bar:, baz:)
+end
+
+def foo
+end
+
+def foo
+ bar
+end
+
+def foo
+ foo
+rescue
+ bar
+ensure
+ baz
+end
+
+def foo
+ bar
+ensure
+ baz
+end
+
+def foo
+ bar
+rescue
+ baz
+end
+
+def foo(bar)
+ bar
+end
+
+def foo(bar, baz)
+ bar
+end
+
+def foo(bar = ())
+ bar
+end
+
+def foo(bar = (baz; nil))
+end
+
+def foo(bar = true)
+ bar
+end
+
+def foo(bar, baz = true)
+ bar
+end
+
+def foo(bar: 1)
+end
+
+def foo(bar: baz)
+end
+
+def foo(bar: bar())
+end
+
+def foo(*)
+ bar
+end
+
+def foo(*bar)
+ bar
+end
+
+def foo(bar, *baz)
+ bar
+end
+
+def foo(baz = true, *bor)
+ bar
+end
+
+def foo(baz = true, *bor, &block)
+ bar
+end
+
+def foo(bar, baz = true, *bor)
+ bar
+end
+
+def foo(&block)
+ bar
+end
+
+def foo(bar, &block)
+ bar
+end
+
+def foo
+ bar
+ baz
+end
+
+def f(((a)))
+end
+
+def foo(bar:, baz: "value")
+end
+
+def f
+ <<-HEREDOC
+ #{}
+ HEREDOC
+end
+
+def f
+ %()
+end