refactor makeValue and makeDeclatator to reduce code duplication

This commit is contained in:
Kurt Hutten IrevDev
2023-01-02 12:18:54 +11:00
parent dbf8a993e5
commit d2a4bb7851
3 changed files with 190 additions and 57 deletions

View File

@ -18,7 +18,7 @@ const newVar = myVar + 1`
const { root } = exe(code)
expect(root.myVar).toBe('a str')
})
it('test assigning a var by cont concatenating two strings string', () => {
it('test assigning a var by cont concatenating two strings string execute', () => {
const code = fs.readFileSync(
'./src/lang/testExamples/variableDeclaration.cado',
'utf-8'
@ -40,7 +40,7 @@ log(5, myVar)`
expect(root.myVar).toBe('hello')
expect(programMemoryOverride.log).toHaveBeenCalledWith(5, 'hello')
})
it('fn funcN = () => {}', () => {
it('fn funcN = () => {} execute', () => {
const { root } = exe(
[
'fn funcN = (a, b) => {',