Sha256: 54ceb0ec96887e35c77d911c82b72c4aff60a735aa28a814239ad5a398275559

Contents?: true

Size: 445 Bytes

Versions: 11

Compression:

Stored size: 445 Bytes

Contents

import ballerina/test;
import ballerina/io;

any[] outputs = [];
int counter = 0;

// This is the mock function which will replace the real function
@test:Mock {
    packageName: "ballerina.io",
    functionName: "println"
}
public function mockPrint(any... s) {
    outputs[counter] = s[0];
    counter++;
}

@test:Config
function testFunc() {
    // Invoking the main function
    main();
    test:assertEquals("Hello, World!", outputs[0]);
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.179 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.178 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.177 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.176 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.175 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.174 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.173 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.172 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.171 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal
trackler-2.2.1.170 tracks/ballerina/exercises/hello-world/tests/hello_world_test.bal