File tree Expand file tree Collapse file tree 3 files changed +75
-0
lines changed
Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change 3838 assert . equal ( sasCodeDoc . getWrappedCode ( ) , expected ) ;
3939 } ) ;
4040
41+ it ( "wrap rlang code" , ( ) => {
42+ const parameters : SASCodeDocumentParameters = {
43+ languageId : "rlang" ,
44+ code : `for (x in 1:6) {
45+ print(x)
46+ }
47+ print("test")` ,
48+ selectedCode : "" ,
49+ htmlStyle : "Illuminate" ,
50+ outputHtml : true ,
51+ uuid : "519058ad-d33b-4b5c-9d23-4cc8d6ffb163" ,
52+ checkKeyword : async ( ) => false ,
53+ } ;
54+
55+ const sasCodeDoc = new SASCodeDocument ( parameters ) ;
56+
57+ const expected = `/** LOG_START_INDICATOR **/
58+ title;footnote;ods _all_ close;
59+ ods graphics on;
60+ ods html5(id=vscode) style=Illuminate options(bitmap_mode='inline' svg_mode='inline') body="519058ad-d33b-4b5c-9d23-4cc8d6ffb163.htm";
61+ proc rlang;
62+ submit;
63+ for (x in 1:6) {
64+ print(x)
65+ }
66+ print("test")
67+ endsubmit;
68+ run;
69+ ;*';*";*/;run;quit;ods html5(id=vscode) close;
70+ ` ;
71+
72+ assert . equal ( sasCodeDoc . getWrappedCode ( ) , expected ) ;
73+ } ) ;
74+
4175 it ( "wrap sql code" , ( ) => {
4276 const parameters : SASCodeDocumentParameters = {
4377 languageId : "sql" ,
Original file line number Diff line number Diff line change @@ -46,6 +46,16 @@ def my_function():
4646endsubmit;
4747run ;
4848
49+ proc rlang ;
50+ submit;
51+ # Reference to variable defined in previous PROC RLANG call
52+ print(paste("x =" , x ))
53+ my_function <- function() {
54+ print("Inside the proc step" )
55+ }
56+ endsubmit;
57+ run ;
58+
4959proc lua ;
5060submit;
5161local dsid = sas.open ("sashelp.company" ) -- open for input
@@ -131,6 +141,17 @@ print('first statement after for loop')
131141endinteractive;
132142run ;
133143
144+ proc rlang ;
145+ submit;
146+ fruits <- c("apple" , "banana" , "cherry" )
147+ for (x in fruits) {
148+ print(x )
149+ }
150+
151+ print('first statement after for loop' )
152+ endsubmit;
153+ run ;
154+
134155proc lua ;
135156submit;
136157
Original file line number Diff line number Diff line change @@ -40,6 +40,15 @@ def my_function():
4040 print("Inside the proc step" )
4141endsubmit;
4242run ;
43+ proc rlang ;
44+ submit;
45+ # Reference to variable defined in previous PROC RLANG call
46+ print(paste("x =" , x ))
47+ my_function <- function() {
48+ print("Inside the proc step" )
49+ }
50+ endsubmit;
51+ run ;
4352proc lua ;
4453submit;
4554local dsid = sas.open ("sashelp.company" ) -- open for input
@@ -126,6 +135,17 @@ print('first statement after for loop')
126135endinteractive;
127136run ;
128137
138+ proc rlang ;
139+ submit;
140+ fruits <- c("apple" , "banana" , "cherry" )
141+ for (x in fruits) {
142+ print(x )
143+ }
144+
145+ print('first statement after for loop' )
146+ endsubmit;
147+ run ;
148+
129149proc lua ;
130150submit;
131151
You can’t perform that action at this time.
0 commit comments