From 039bb97123fd8a74b9954598d7a102e235fd108d Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 30 Nov 2016 18:25:57 +0300 Subject: Fixed tests for sample formats --- core/testdata/format/website-samples/sample.kt | 16 +++++++++ core/testdata/format/website-samples/sample.md | 38 ++++++++++++++++++++++ .../format/website-samples/sampleWithAsserts.kt | 15 +++++++++ .../format/website-samples/sampleWithAsserts.md | 23 +++++++++++++ core/testdata/format/website/sample.md | 9 ----- core/testdata/format/website/sampleWithAsserts.kt | 15 --------- core/testdata/format/website/sampleWithAsserts.md | 23 ------------- 7 files changed, 92 insertions(+), 47 deletions(-) create mode 100644 core/testdata/format/website-samples/sample.kt create mode 100644 core/testdata/format/website-samples/sample.md create mode 100644 core/testdata/format/website-samples/sampleWithAsserts.kt create mode 100644 core/testdata/format/website-samples/sampleWithAsserts.md delete mode 100644 core/testdata/format/website/sampleWithAsserts.kt delete mode 100644 core/testdata/format/website/sampleWithAsserts.md (limited to 'core/testdata') diff --git a/core/testdata/format/website-samples/sample.kt b/core/testdata/format/website-samples/sample.kt new file mode 100644 index 00000000..a664c2f5 --- /dev/null +++ b/core/testdata/format/website-samples/sample.kt @@ -0,0 +1,16 @@ +/** + * Groups elements of the original sequence by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * @sample example1 + */ +fun foo(): Int { + return 0 +} + +fun foo(i: Int): Int { + return 1 +} + +fun example1(node: String) = if (true) { + println(property) +} diff --git a/core/testdata/format/website-samples/sample.md b/core/testdata/format/website-samples/sample.md new file mode 100644 index 00000000..203f1b02 --- /dev/null +++ b/core/testdata/format/website-samples/sample.md @@ -0,0 +1,38 @@ +--- +title: foo - test +layout: api +--- + +
test / foo
+ +# foo + +
+ +
fun foo(): Int
+ +Groups elements of the original sequence by the key returned by the given keySelector function +applied to each element and returns a map where each group key is associated with a list of corresponding elements. + +
+ +``` kotlin + +fun main(args: Array) { +//sampleStart +if (true) { + println(property) +} +//sampleEnd +} +``` + +
+ +
+ +
+ +
fun foo(i: Int): Int
+ +
diff --git a/core/testdata/format/website-samples/sampleWithAsserts.kt b/core/testdata/format/website-samples/sampleWithAsserts.kt new file mode 100644 index 00000000..bb9732d5 --- /dev/null +++ b/core/testdata/format/website-samples/sampleWithAsserts.kt @@ -0,0 +1,15 @@ +/** + * @sample sample + */ +fun a(): String { + return "Hello, Work" +} + +fun b(): String { + return "Hello, Rest" +} + +fun sample() { + assertPrints(a(), "Hello, Work") + assertTrue(a() == b()) +} \ No newline at end of file diff --git a/core/testdata/format/website-samples/sampleWithAsserts.md b/core/testdata/format/website-samples/sampleWithAsserts.md new file mode 100644 index 00000000..98d7df33 --- /dev/null +++ b/core/testdata/format/website-samples/sampleWithAsserts.md @@ -0,0 +1,23 @@ +--- +title: a - test +layout: api +--- + +
test / a
+ +# a + +
fun a(): String
+
+ +``` kotlin + +fun main(args: Array) { +//sampleStart +println(a()) // Hello, Work +println("a() == b() is ${a() == b()}") // true +//sampleEnd +} +``` + +
diff --git a/core/testdata/format/website/sample.md b/core/testdata/format/website/sample.md index 203f1b02..7c11790f 100644 --- a/core/testdata/format/website/sample.md +++ b/core/testdata/format/website/sample.md @@ -14,23 +14,14 @@ layout: api Groups elements of the original sequence by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a list of corresponding elements. -
- ``` kotlin - -fun main(args: Array) { -//sampleStart if (true) { println(property) } -//sampleEnd -} ```
- -
fun foo(i: Int): Int
diff --git a/core/testdata/format/website/sampleWithAsserts.kt b/core/testdata/format/website/sampleWithAsserts.kt deleted file mode 100644 index bb9732d5..00000000 --- a/core/testdata/format/website/sampleWithAsserts.kt +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @sample sample - */ -fun a(): String { - return "Hello, Work" -} - -fun b(): String { - return "Hello, Rest" -} - -fun sample() { - assertPrints(a(), "Hello, Work") - assertTrue(a() == b()) -} \ No newline at end of file diff --git a/core/testdata/format/website/sampleWithAsserts.md b/core/testdata/format/website/sampleWithAsserts.md deleted file mode 100644 index 98d7df33..00000000 --- a/core/testdata/format/website/sampleWithAsserts.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: a - test -layout: api ---- - - - -# a - -
fun a(): String
-
- -``` kotlin - -fun main(args: Array) { -//sampleStart -println(a()) // Hello, Work -println("a() == b() is ${a() == b()}") // true -//sampleEnd -} -``` - -
-- cgit