Giter Club home page Giter Club logo

Comments (5)

jclark avatar jclark commented on September 14, 2024 1

I was thinking of

import ballerina/io;

public function main() {
  io:println(add(1, 2)); // @output 3
}

function add(int x, int y) returns int {
   return x + y;
}

from nballerina.

manuranga avatar manuranga commented on September 14, 2024
// @invoke 1, 2
// @expect 3
function test(int x, int y) returns int {
    int diff = x - y;
    return diff;
}

how about a format like above.

from nballerina.

jclark avatar jclark commented on September 14, 2024

I have used a convention where the name of a valid test case (a program that should compile and run without panicking) starts with the letter V; these have @output comments specifying the expected output.

I envisage having other letters for other categories of test case, including

  • P: this compiles but panics when executed: this would have a @panic comment on the line which should panic
  • E: this should get a compilation error: this would have an @error on the line on which an error should be reported; this should only be for cases that are errors according to the full Ballerina spec (XXX need a way to distinguish whether parse error or semantic error is expected)
  • U: this should be like a V test, but is for something that is not in the subset: this should result in an error of type parse or unsupported not not semantic; when a feature is implemented U tests can be renamed to V tests
  • F: this is for current failing test cases; it should be followed by one of the other letters

from nballerina.

jclark avatar jclark commented on September 14, 2024

We should use a DataProvider with testerina to run all the test cases: this should leave .ll files for all the V cases. These .ll cases can separately be tested using the testll.sh script.

from nballerina.

jclark avatar jclark commented on September 14, 2024

Still need to do #81 and #89, but this is enough for subset01

from nballerina.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.