From f462317925b3706a4184ba468a353e573a4877c5 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 2 Mar 2015 16:17:28 +0100 Subject: for functions that can be called as operators, show operator being implemented --- test/data/format/operatorOverloading.kt | 3 +++ test/data/format/operatorOverloading.md | 8 ++++++++ test/src/format/MarkdownFormatTest.kt | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 test/data/format/operatorOverloading.kt create mode 100644 test/data/format/operatorOverloading.md (limited to 'test') diff --git a/test/data/format/operatorOverloading.kt b/test/data/format/operatorOverloading.kt new file mode 100644 index 00000000..6fe78e45 --- /dev/null +++ b/test/data/format/operatorOverloading.kt @@ -0,0 +1,3 @@ +class C { + fun plus(other: C): C +} diff --git a/test/data/format/operatorOverloading.md b/test/data/format/operatorOverloading.md new file mode 100644 index 00000000..fd0fa977 --- /dev/null +++ b/test/data/format/operatorOverloading.md @@ -0,0 +1,8 @@ +[test](test/index) / [C](test/-c/index) / [plus](test/-c/plus) + + +# plus + +`fun plus(other: [C](test/-c/index)): [C](test/-c/index)` +Implements **operator `+`** + diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt index 7164fdee..31ffc3cf 100644 --- a/test/src/format/MarkdownFormatTest.kt +++ b/test/src/format/MarkdownFormatTest.kt @@ -148,4 +148,10 @@ public class MarkdownFormatTest { markdownService.appendNodes(tempLocation, output, model.members.single().members) } } + + Test fun operatorOverloading() { + verifyOutput("test/data/format/operatorOverloading.kt", ".md") { model, output -> + markdownService.appendNodes(tempLocation, output, model.members.single().members.single { it.name == "C" }.members.filter { it.name == "plus" }) + } + } } -- cgit