aboutsummaryrefslogtreecommitdiff
path: root/core/testdata/format/website-html/sampleWithAsserts.html
blob: 3febe91e5d2a5f818c84d283f69b678707385b08 (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
25
26
27
28
<div class='api-docs-breadcrumbs'><a href="../index.html">test</a> / <a href="./a.html">a</a></div>
<h1>a</h1>
<div class="node-page-main" data-platform="" data-kotlin-version=""><div class="tags"><div class="spacer"></div>
<div class="tags__tag kotlin-version"></div>
</div>
<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" data-min-compiler-version="1.3"><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>
</div>