try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "k1"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "k1"), errorInfo.getTopLevelFunctionName());
assertEquals(81, errorInfo.getLine());
assertEquals(5, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "k2"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// The compiler seems to mess up source positions so I can use the exact position
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "k2"), errorInfo.getTopLevelFunctionName());
assertEquals(86, errorInfo.getLine());
assertEquals(5, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "k3"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// The compiler seems to mess up source positions so I can use the exact position
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "k3"), errorInfo.getTopLevelFunctionName());
assertEquals(96, errorInfo.getLine());
assertEquals(5, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "j"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "j"), errorInfo.getTopLevelFunctionName());
assertEquals(105, errorInfo.getLine());
assertEquals(12, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "m"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "m"), errorInfo.getTopLevelFunctionName());
assertEquals(118, errorInfo.getLine());
assertEquals(9, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "n"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "n"), errorInfo.getTopLevelFunctionName());
assertEquals(122, errorInfo.getLine());
assertEquals(8, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "o"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "o"), errorInfo.getTopLevelFunctionName());
assertEquals(132, errorInfo.getLine());
assertEquals(9, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "p"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "p"), errorInfo.getTopLevelFunctionName());
assertEquals(136, errorInfo.getLine());
assertEquals(10, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "q"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "q"), errorInfo.getTopLevelFunctionName());
assertEquals(143, errorInfo.getLine());
assertEquals(10, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "r"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "r"), errorInfo.getTopLevelFunctionName());
assertEquals(149, errorInfo.getLine());
assertEquals(13, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "s"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "s"), errorInfo.getTopLevelFunctionName());
assertEquals(156, errorInfo.getLine());
assertEquals(9, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "t"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "t"), errorInfo.getTopLevelFunctionName());
assertEquals(165, errorInfo.getLine());
assertEquals(8, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "testCases"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "testCases"), errorInfo.getTopLevelFunctionName());
assertEquals(178, errorInfo.getLine());
assertEquals(17, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "testCasesRecord"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "testCasesRecord"), errorInfo.getTopLevelFunctionName());
assertEquals(187, errorInfo.getLine());
assertEquals(9, errorInfo.getColumn());
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(CALPlatformTestModuleNames.ErrorTest, "f"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
assertTrue( -1 != e.toString().indexOf("hi") );
}
try{
CALServicesTestUtilities.runNamedFunction(QualifiedName.make(ModuleName.make("MyFunModule"), "myFunFunction"), calServices);
fail( "This should have failed" );
}
catch(CALExecutorException.ExternalException.ErrorFunctionException e){
// This does not have position information because the call is evaluated lazily.
ErrorInfo errorInfo = e.getErrorInfo();
assertNotNull(errorInfo);
// The compiler seems to mess up source positions so I can use the exact position
assertEquals(QualifiedName.make(ModuleName.make("MyFunModule"), "myFunFunction"), errorInfo.getTopLevelFunctionName());
// assertEquals(72, errorInfo.getLine());
// assertEquals(5, errorInfo.getColumn());
}
}