File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments