Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port SemType Tests from nBallerina to lang repo Tests #34629

Closed
gimantha opened this issue Jan 12, 2022 · 7 comments
Closed

Port SemType Tests from nBallerina to lang repo Tests #34629

gimantha opened this issue Jan 12, 2022 · 7 comments
Assignees
Labels
Points/6 Equivalent to six days effort Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Task

Comments

@gimantha
Copy link
Contributor

$Subject.
No of people: 2

@gimantha gimantha added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Jan 12, 2022
@chiranSachintha chiranSachintha added the Points/6 Equivalent to six days effort label Jan 12, 2022
@KavinduZoysa
Copy link
Contributor

As per the discussion had with @hasithaa, @rdhananjaya, @gimantha, @chiranSachintha,
our plan is,

  • write semtype test runner to check all subtype relations for given test file
  • split the test available here into small pieces and change the comment to include all possible relations in order to test against semtype test runner.

@KavinduZoysa
Copy link
Contributor

KavinduZoysa commented Jan 15, 2022

We have to write separate tests for type tests available in here.
@chiranSachintha, let's restrict each test file to having a maximum of four relations.
Any failing test case should be present in a single bal file and it should be renamed as -f.bal

Sub tasks:

  • anydata-tv.bal
  • fixed-length-array-t.bal
  • proj2-tv.bal
  • table-t.bal
  • tuple2-tv.bal
  • tuple4-tv.bal
  • xml-complex-rw-tv.bal
  • xml-readonly-tv.bal
  • xml-te.bal
  • bdddiff1-tv.bal
  • fixed-length-array-tuple-t.bal
  • proj1-tv.bal
  • table2-t.bal
  • tuple1-tv.bal
  • tuple3-tv.bal
  • xml-complex-ro-tv.bal
  • xml-never-tv.bal
  • xml-sequence-tv.bal
  • not1-tv.bal

@KavinduZoysa
Copy link
Contributor

@chiranSachintha, let's do our changes in this branch https://github.com/ballerina-platform/ballerina-lang/tree/semtype-tests

@KavinduZoysa
Copy link
Contributor

KavinduZoysa commented Jan 18, 2022

Identified issues:
#34696
#34711
#34728
#34737
#34779

@chiranSachintha
Copy link
Member

chiranSachintha commented Jan 18, 2022

As discussed with @rdhananjaya We are going to ignore the following two kinds of test cases which are in the semtype test suite

  1. Intersection related tests(Because we doesn't support these kinds of scenarios)

Example

type IntArray int[];
type ArrayExcept5 IntArray & IntArray;
  1. kind of array related test cases

Example

type IntArray int[];
// @type IntArray = Array5OfIntArray[4]
type Array5OfIntArray int[5][];

In this test case, generate a value related to Array5OfIntArray and get the type related to the fourth element of the value. (But there's no way to generate it in jballerina)

Any idea to port this kind of test cases? @gimantha @MaryamZi @hasithaa @KavinduZoysa

@KavinduZoysa
Copy link
Contributor

KavinduZoysa commented Jan 18, 2022

@chiranSachintha, I think,
in case 1:
since we support & operator with readonly and error we can ignore that test case.
in case 2:
Sometimes we will be able to find test cases that can be rearranged to support our implementations.
ex:
Let's say we have to test something like this.

type IntArray int[];
// @type IntArray <: Array5OfIntOrFloatArray[4]
type Array5OfIntOrFloatArray (int|float)[5][];

Even we can't test this as it is, we can rearrange this as follows.

type IntArray int[];
// IntArray<:IntOrFloatArray
type IntOrFloatArray (int|float)[];

@MaryamZi
Copy link
Member

As discussed with @rdhananjaya We are going to ignore the following two kinds of test cases which are in the semtype test suite

  1. Intersection related tests(Because we doesn't support these kinds of scenarios)

Example

type IntArray int[];
type ArrayExcept5 IntArray & IntArray;

Depending on the effort, can't we migrate these also and keep them disabled and enable them as and when we add support for other kinds of intersections?

  1. kind of array related test cases

Example

type IntArray int[];
// @type IntArray = Array5OfIntArray[4]
type Array5OfIntArray int[5][];

In this test case, generate a value related to Array5OfIntArray and get the type related to the fourth element of the value. (But there's no way to generate it in jballerina)

When you say value, do you mean a runtime test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Points/6 Equivalent to six days effort Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Task
Projects
None yet
Development

No branches or pull requests

4 participants