Skip to content

Commit 04d7f3d

Browse files
committed
add testcase
1 parent 9b864c0 commit 04d7f3d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/builtin/from_mixed.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import {expect} from "chai";
2+
import {ABAP, MemoryConsole} from "../../packages/runtime/src";
3+
import {AsyncFunction, runFiles} from "../_utils";
4+
5+
let abap: ABAP;
6+
7+
async function run(contents: string) {
8+
return runFiles(abap, [{filename: "zfoobar.prog.abap", contents}]);
9+
}
10+
11+
describe("Builtin functions - from_mixed", () => {
12+
13+
beforeEach(async () => {
14+
abap = new ABAP({console: new MemoryConsole()});
15+
});
16+
17+
it.only("test", async () => {
18+
const code = `
19+
WRITE / from_mixed( 'putData' ).
20+
WRITE / from_mixed( 'PutData' ).
21+
WRITE / from_mixed( 'PUTDATA' ).
22+
WRITE / from_mixed( 'putdata' ).
23+
WRITE / from_mixed( 'put data' ).
24+
WRITE / from_mixed( 'put Data' ).
25+
`;
26+
const js = await run(code);
27+
const f = new AsyncFunction("abap", js);
28+
await f(abap);
29+
expect(abap.console.get()).to.equal(`PUT_DATA
30+
PUT_DATA
31+
P_U_T_D_A_T_A
32+
PUTDATA
33+
PUT DATA
34+
PUT _DATA`);
35+
});
36+
37+
});

0 commit comments

Comments
 (0)