catb0t / tart

Automatically exported from code.google.com/p/tart
0 stars 0 forks source link

Returning pair inside test case crashes #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I compiled tart for x86_64 using LLVM head (rev. 121003). With this setup, the 
following test case crashes:

import tart.testing.Test;

@EntryPoint
def main(args:String[]) -> int32 {
  return Test.run(BugTest1);
}

class BugTest1 : Test {

  def theQuestionOfLife() -> (int, bool) {
    return (42, true);
  }

  // This test case crashes the application.
  def testBad() {
    let a = theQuestionOfLife();
    assertEq(42, a[0]);
    assertTrue(a[1]);   
  }
}

The crash goes away if you move method theQuestionOfLife() into another class 
or to the module level.
Therefore I suspect that it is a general problem.

Original issue reported on code.google.com by kai.na...@gmail.com on 7 Dec 2010 at 5:27

Attachments:

GoogleCodeExporter commented 8 years ago
I think I might have already fixed this, and just not pushed it yet. I'll look 
into it.

Thanks!

Original comment by viri...@gmail.com on 7 Dec 2010 at 5:43

GoogleCodeExporter commented 8 years ago
Looks like this has already been fixed. Tests added.

Original comment by viri...@gmail.com on 17 Jan 2011 at 3:41