better output when unit test fails for structures (#139)
This commit is contained in:
@@ -108,7 +108,7 @@ class Runner {
|
||||
fs.writeFileSync(path.join(this.tmpDir, "abap_transpile.json"), JSON.stringify(config, null, 2));
|
||||
execSync(`cp ${inputDir}/*.abap ${this.tmpDir}`, {stdio: 'pipe'});
|
||||
fs.mkdirSync(`${this.tmpDir}/deps`);
|
||||
execSync(`cp open-abap/src/unit/*.clas.abap ${this.tmpDir}/deps/`, {stdio: 'pipe'});
|
||||
execSync(`cp open-abap/src/unit/*.clas*.abap ${this.tmpDir}/deps/`, {stdio: 'pipe'});
|
||||
execSync(`cp open-abap/src/exceptions/* ${this.tmpDir}/deps/`, {stdio: 'pipe'});
|
||||
execSync(`cp open-abap/src/cl_abap_char_utilities.clas.abap ${this.tmpDir}/deps/`, {stdio: 'pipe'});
|
||||
execSync(`cp open-abap/src/cl_message_helper.clas.abap ${this.tmpDir}/deps/`, {stdio: 'pipe'});
|
||||
|
||||
@@ -76,4 +76,8 @@ describe('abap-test-runner', async () => {
|
||||
it('no-chained-assignment', async () => {
|
||||
test("no-chained-assignment", "error");
|
||||
});
|
||||
|
||||
it('structure-fail', async () => {
|
||||
test("structure-fail", "fail");
|
||||
});
|
||||
});
|
||||
1
tests/structure-fail/expected_results.json
Normal file
1
tests/structure-fail/expected_results.json
Normal file
@@ -0,0 +1 @@
|
||||
{"version":2,"status":"fail","tests":[{"name":"TEST","status":"fail","message":"Expected 'field: 2', got 'field: 1'"}]}
|
||||
8
tests/structure-fail/zcl_simple.clas.abap
Normal file
8
tests/structure-fail/zcl_simple.clas.abap
Normal file
@@ -0,0 +1,8 @@
|
||||
CLASS zcl_simple DEFINITION PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS zcl_simple IMPLEMENTATION.
|
||||
|
||||
ENDCLASS.
|
||||
23
tests/structure-fail/zcl_simple.clas.testclasses.abap
Normal file
23
tests/structure-fail/zcl_simple.clas.testclasses.abap
Normal file
@@ -0,0 +1,23 @@
|
||||
CLASS ltcl_simple DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS test FOR TESTING RAISING cx_static_check.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS ltcl_simple IMPLEMENTATION.
|
||||
|
||||
METHOD test.
|
||||
TYPES: BEGIN OF ty,
|
||||
field TYPE i,
|
||||
END OF ty.
|
||||
DATA data1 TYPE ty.
|
||||
DATA data2 TYPE ty.
|
||||
data1-field = 1.
|
||||
data2-field = 2.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
act = data1
|
||||
exp = data2 ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user