aboutsummaryrefslogtreecommitdiff
path: root/core/testdata/format/website-html/sampleWithAsserts.html
blob: 2b2a9ac5705b98dfeacb645ec9364b9eb24d4de8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<div class='api-docs-breadcrumbs'><a href="index.html">test</a> / <a href="./a.html">a</a></div>
<h1>a</h1>
<a name="$a()"></a>
<div class="signature"><code><span class="keyword">fun </span><span class="identifier">a</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">String</span></code></div>
<div class="sample"><pre><code class="lang-kotlin">import java.io.FileNotFoundException
import java.io.File

fun main(args: Array&lt;String&gt;) {
//sampleStart
println(a()) // Hello, Work
println("a() == b() is ${a() == b()}") // true
// A eq B
println("a() == b() is ${a() == b()}") // true
// readSomeFile(File("some.txt")) // reading file now will fail
// readSomeFile(File("some.txt")) // will fail with FileNotFoundException

// readSomeFile(File("some.txt")) //  will fail

fun indented() {
    // A neq B
    println("a() != b() is ${a() != b()}") // false
}
//sampleEnd
}</code></pre></div>