You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are two unit tests that I added to TypeScript Lizzie to cover validateThatSymbolIsUndefined in the Binder. This is called from the Var function in Functions.cs, so I added this to my Functions test.
it('CannotDefineNonSymbol', () => {
var lambda = LambdaCompiler.compileNoContext(`var(3, 17)`);
var success = true;
try {
lambda();
success = false;
} catch (e) {
expect(e.error).toMatch(/A valid symbol must be specified, but the non-string value '3' was given./i);
}
expect(success).toBe(true);
});
it('CannotRedefineSymbol', () => {
var lambda = LambdaCompiler.compileNoContext(`var(@x, 17) var(@x, 17)`);
var success = true;
try {
lambda();
success = false;
} catch (e) {
expect(e.error).toMatch(/The symbol 'x' has already been declared in the scope of where you are trying to declare it using the 'var' keyword./i);
}
expect(success).toBe(true);
});
The text was updated successfully, but these errors were encountered:
Here are two unit tests that I added to TypeScript Lizzie to cover
validateThatSymbolIsUndefined
in the Binder. This is called from the Var function in Functions.cs, so I added this to my Functions test.The text was updated successfully, but these errors were encountered: