Skip to content

Commit

Permalink
test: update test to be more complex
Browse files Browse the repository at this point in the history
  • Loading branch information
rycont authored Jan 26, 2025
1 parent 7a268f8 commit 5046fe5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
30 changes: 27 additions & 3 deletions runtest.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
import { yaksok } from '@dalbit-yaksok/core'

// const quickJS = new QuickJS({
// prompt,
// })

// await quickJS.init()

await yaksok(
`
약속, 회전설정
결과: "rotate"
약속, 물어보기
결과: "성공"
약속, (질문) 물어보기
결과: "이건 아님"
(회전설정) 보여주기
(물어보기) + 물어보기 * 3 보여주기
("뭐라도" 물어보기) + ("뭐라도" 물어보기) * 3 보여주기
`,
// {
// runFFI(runtime, bodyCode, args) {
// if (runtime === 'JavaScript') {
// const result = quickJS.run(bodyCode, args)
// if (!result) {
// throw new Error('Result is null')
// }

// return result
// }

// throw new Error(`Unknown runtime: ${runtime}`)
// },
// },
)
11 changes: 10 additions & 1 deletion test/connect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,13 @@ Deno.test('한 단어로 된 FFI 이름', async () => {
return "성공"
***
번역(QuickJS), (질문) 물어보기
***
return "이건 아님"
***
(물어보기) + 물어보기 * 3 보여주기
("뭐라도" 물어보기) + ("뭐라도" 물어보기) * 3 보여주기
`,
{
runFFI(runtime, bodyCode, args) {
Expand All @@ -273,5 +279,8 @@ Deno.test('한 단어로 된 FFI 이름', async () => {
},
)

assertEquals(output, '성공성공성공성공\n')
assertEquals(
output,
'성공성공성공성공\n이건 아님이건 아님이건 아님이건 아님\n',
)
})

0 comments on commit 5046fe5

Please sign in to comment.