forked from eclipse-che4z/che-che4z-lsp-for-cobol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow floating comments in DaCo COPY MAID statements
- Loading branch information
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...st/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithFloatingComment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2024 DAF Trucks NV. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* DAF Trucks NV – implementation of DaCo COBOL statements | ||
* and DAF development standards | ||
*/ | ||
package org.eclipse.lsp.cobol.dialects.daco.usecases; | ||
|
||
import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; | ||
import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; | ||
import org.eclipse.lsp.cobol.test.CobolText; | ||
import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.google.common.collect.ImmutableMap; | ||
|
||
/** This test checks that COPY MAID statement is parsed correctly with a floating comment */ | ||
public class TestCopyMaidWithFloatingComment { | ||
private static final String TEXT = | ||
" IDENTIFICATION DIVISION.\n" | ||
+ " PROGRAM-ID. PARTEST.\n" | ||
+ " ENVIRONMENT DIVISION.\n" | ||
+ " IDMS-CONTROL SECTION.\n" | ||
+ " PROTOCOL. MODE ABC.\n" | ||
+ " IDMS-RECORDS MANUAL\n" | ||
+ " DATA DIVISION.\n" | ||
+ " WORKING-STORAGE SECTION.\n" | ||
+ " 01 COPY MAID {~NAME!DaCo}. *>@@Hello, World!!@#$\n" | ||
+ " PROCEDURE DIVISION.\n" | ||
+ " DISPLAY {$ABC}."; | ||
|
||
private static final String COPYBOOK = " 01 {$*ABC} PIC 9."; | ||
|
||
@Test | ||
void test() { | ||
UseCaseEngine.runTest( | ||
TEXT, | ||
ImmutableList.of(new CobolText("NAME", DaCoDialect.NAME, COPYBOOK)), | ||
ImmutableMap.of(), ImmutableList.of(), DialectConfigs.getDaCoAnalysisConfig()); | ||
} | ||
} |