From a8627954b1bfe5a504bf09fdfbf85017342bd407 Mon Sep 17 00:00:00 2001 From: christophkloeffel Date: Tue, 16 Jan 2024 12:45:06 +0100 Subject: [PATCH] review comments of #66 --- tests-system/rbt-endswith-semantics/foo.trlc | 4 +++ tests-system/rbt-endswith-semantics/output | 4 ++- .../rbt-endswith-semantics/output.brief | 1 + .../rbt-endswith-semantics/output.json | 7 +++++- .../rbt-endswith-semantics/output.smtlib | 4 ++- tests-system/rbt-len-semantics/foo.rsl | 1 - tests-system/rbt-len-semantics/foo.trlc | 1 - tests-system/rbt-len-semantics/output.json | 1 - tests-system/rbt-matches-semantics/foo.rsl | 8 ++++-- tests-system/rbt-matches-semantics/foo.trlc | 16 +++++++++--- tests-system/rbt-matches-semantics/output | 10 +++++++- .../rbt-matches-semantics/output.brief | 4 +++ .../rbt-matches-semantics/output.json | 25 +++++++++++++++---- .../rbt-matches-semantics/output.smtlib | 10 +++++++- tests-system/rbt-signature-len-1/foo.rsl | 1 - tests-system/rbt-signature-len-1/output | 2 +- tests-system/rbt-signature-len-1/output.brief | 2 +- tests-system/rbt-signature-len-1/output.json | 2 +- .../rbt-signature-len-1/output.smtlib | 2 +- tests-system/rbt-signature-len-2/foo.rsl | 1 - tests-system/rbt-signature-len-2/foo.trlc | 1 - tests-system/rbt-signature-len-2/output | 2 +- tests-system/rbt-signature-len-2/output.brief | 2 +- tests-system/rbt-signature-len-2/output.json | 2 +- .../rbt-signature-len-2/output.smtlib | 2 +- tests-system/rbt-signature-matches-1/foo.rsl | 2 -- tests-system/rbt-signature-matches-1/output | 2 +- .../rbt-signature-matches-1/output.brief | 2 +- .../rbt-signature-matches-1/output.json | 2 +- .../rbt-signature-matches-1/output.smtlib | 2 +- tests-system/rbt-signature-matches-2/foo.rsl | 1 - tests-system/rbt-signature-matches-2/foo.trlc | 1 - tests-system/rbt-signature-matches-2/output | 2 +- .../rbt-signature-matches-2/output.brief | 2 +- .../rbt-signature-matches-2/output.json | 2 +- .../rbt-signature-matches-2/output.smtlib | 2 +- tests-system/rbt-signature-matches-3/foo.rsl | 2 +- tests-system/rbt-signature-matches-3/output | 2 +- .../rbt-signature-matches-3/output.json | 2 +- .../rbt-signature-matches-3/output.smtlib | 2 +- .../foo.rsl | 5 +--- .../output | 4 +-- .../output.brief | 2 +- .../output.json | 4 +-- .../output.smtlib | 4 +-- .../foo.rsl | 1 - .../foo.trlc | 1 - .../output | 2 +- .../output.brief | 2 +- .../output.json | 2 +- .../output.smtlib | 2 +- .../foo.rsl | 11 ++++++++ .../output | 3 +++ .../output.brief | 1 + .../output.json | 3 +++ .../output.smtlib | 3 +++ 56 files changed, 130 insertions(+), 63 deletions(-) create mode 100644 tests-system/rbt-signature-string-end-functions-3/foo.rsl create mode 100644 tests-system/rbt-signature-string-end-functions-3/output create mode 100644 tests-system/rbt-signature-string-end-functions-3/output.brief create mode 100644 tests-system/rbt-signature-string-end-functions-3/output.json create mode 100644 tests-system/rbt-signature-string-end-functions-3/output.smtlib diff --git a/tests-system/rbt-endswith-semantics/foo.trlc b/tests-system/rbt-endswith-semantics/foo.trlc index 5013e982..7a96754c 100644 --- a/tests-system/rbt-endswith-semantics/foo.trlc +++ b/tests-system/rbt-endswith-semantics/foo.trlc @@ -3,3 +3,7 @@ package Foo T Bar { b = "kitten" } + +T Baz { + b = "dog" +} diff --git a/tests-system/rbt-endswith-semantics/output b/tests-system/rbt-endswith-semantics/output index a36e3bac..955c7b2a 100644 --- a/tests-system/rbt-endswith-semantics/output +++ b/tests-system/rbt-endswith-semantics/output @@ -1 +1,3 @@ -Processed 1 model and 1 requirement file and found no issues +b = "dog" + ^^^^^ rbt-endswith-semantics/foo.trlc:8: check warning: b should end with en +Processed 1 model and 1 requirement file and found 1 warning diff --git a/tests-system/rbt-endswith-semantics/output.brief b/tests-system/rbt-endswith-semantics/output.brief index e69de29b..2dfdfc0a 100644 --- a/tests-system/rbt-endswith-semantics/output.brief +++ b/tests-system/rbt-endswith-semantics/output.brief @@ -0,0 +1 @@ +rbt-endswith-semantics/foo.trlc:8:9: trlc check warning: b should end with en diff --git a/tests-system/rbt-endswith-semantics/output.json b/tests-system/rbt-endswith-semantics/output.json index 37f5ecfc..25c1c2dc 100644 --- a/tests-system/rbt-endswith-semantics/output.json +++ b/tests-system/rbt-endswith-semantics/output.json @@ -1,6 +1,11 @@ +b = "dog" + ^^^^^ rbt-endswith-semantics/foo.trlc:8: check warning: b should end with en { "Bar": { "b": "kitten" + }, + "Baz": { + "b": "dog" } } -Processed 1 model and 1 requirement file and found no issues +Processed 1 model and 1 requirement file and found 1 warning diff --git a/tests-system/rbt-endswith-semantics/output.smtlib b/tests-system/rbt-endswith-semantics/output.smtlib index a36e3bac..955c7b2a 100644 --- a/tests-system/rbt-endswith-semantics/output.smtlib +++ b/tests-system/rbt-endswith-semantics/output.smtlib @@ -1 +1,3 @@ -Processed 1 model and 1 requirement file and found no issues +b = "dog" + ^^^^^ rbt-endswith-semantics/foo.trlc:8: check warning: b should end with en +Processed 1 model and 1 requirement file and found 1 warning diff --git a/tests-system/rbt-len-semantics/foo.rsl b/tests-system/rbt-len-semantics/foo.rsl index ea052081..01823f75 100644 --- a/tests-system/rbt-len-semantics/foo.rsl +++ b/tests-system/rbt-len-semantics/foo.rsl @@ -2,7 +2,6 @@ package Foo type T { a String - b Integer c Integer[1..*] } diff --git a/tests-system/rbt-len-semantics/foo.trlc b/tests-system/rbt-len-semantics/foo.trlc index f3bd6ce1..354b3682 100644 --- a/tests-system/rbt-len-semantics/foo.trlc +++ b/tests-system/rbt-len-semantics/foo.trlc @@ -2,6 +2,5 @@ package Foo T Bar { a = "potato" - b = 1 c = [2,1] } diff --git a/tests-system/rbt-len-semantics/output.json b/tests-system/rbt-len-semantics/output.json index fa391476..5426a898 100644 --- a/tests-system/rbt-len-semantics/output.json +++ b/tests-system/rbt-len-semantics/output.json @@ -1,7 +1,6 @@ { "Bar": { "a": "potato", - "b": 1, "c": [ 2, 1 diff --git a/tests-system/rbt-matches-semantics/foo.rsl b/tests-system/rbt-matches-semantics/foo.rsl index aac4b3bc..61010e5b 100644 --- a/tests-system/rbt-matches-semantics/foo.rsl +++ b/tests-system/rbt-matches-semantics/foo.rsl @@ -3,9 +3,13 @@ package Foo type T { a String b String - c Integer + c String + d String } checks T { - matches(a, "potato"), warning "a should match with potato", a + matches(a, "^[a-zA-Z0-9]{6,12}$"), warning "a should match with 6 to 12 letters or digits", a + matches(b, "\w+"), warning "b should match only letters, digits, or underscores.", b + matches(c, "potato"), warning "b should start with 'potato'.", c + matches(d, "^D.*"), warning "d should start with D", d } diff --git a/tests-system/rbt-matches-semantics/foo.trlc b/tests-system/rbt-matches-semantics/foo.trlc index 71700516..29637019 100644 --- a/tests-system/rbt-matches-semantics/foo.trlc +++ b/tests-system/rbt-matches-semantics/foo.trlc @@ -1,7 +1,15 @@ package Foo -T Bar { - a = "potato" - b = "kitten" - c = 1 +T No_Regex_Matches { + a = "123456789 abcdefghijklmn" + b = "??...kitten_...??" + c = "not potato" + d = "not Diego" +} + +T All_Regex_Matches { + a = "123abc" + b = "3_kitten_" + c = "potato and tomato sauce" + d = "Diego" } diff --git a/tests-system/rbt-matches-semantics/output b/tests-system/rbt-matches-semantics/output index a36e3bac..6eca8c36 100644 --- a/tests-system/rbt-matches-semantics/output +++ b/tests-system/rbt-matches-semantics/output @@ -1 +1,9 @@ -Processed 1 model and 1 requirement file and found no issues +a = "123456789 abcdefghijklmn" + ^^^^^^^^^^^^^^^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:4: check warning: a should match with 6 to 12 letters or digits +b = "??...kitten_...??" + ^^^^^^^^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:5: check warning: b should match only letters, digits, or underscores. +c = "not potato" + ^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:6: check warning: b should start with 'potato'. +d = "not Diego" + ^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:7: check warning: d should start with D +Processed 1 model and 1 requirement file and found 4 warnings diff --git a/tests-system/rbt-matches-semantics/output.brief b/tests-system/rbt-matches-semantics/output.brief index e69de29b..012393b2 100644 --- a/tests-system/rbt-matches-semantics/output.brief +++ b/tests-system/rbt-matches-semantics/output.brief @@ -0,0 +1,4 @@ +rbt-matches-semantics/foo.trlc:4:9: trlc check warning: a should match with 6 to 12 letters or digits +rbt-matches-semantics/foo.trlc:5:9: trlc check warning: b should match only letters, digits, or underscores. +rbt-matches-semantics/foo.trlc:6:9: trlc check warning: b should start with 'potato'. +rbt-matches-semantics/foo.trlc:7:9: trlc check warning: d should start with D diff --git a/tests-system/rbt-matches-semantics/output.json b/tests-system/rbt-matches-semantics/output.json index 4d25cf13..9885b02d 100644 --- a/tests-system/rbt-matches-semantics/output.json +++ b/tests-system/rbt-matches-semantics/output.json @@ -1,8 +1,23 @@ +a = "123456789 abcdefghijklmn" + ^^^^^^^^^^^^^^^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:4: check warning: a should match with 6 to 12 letters or digits +b = "??...kitten_...??" + ^^^^^^^^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:5: check warning: b should match only letters, digits, or underscores. +c = "not potato" + ^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:6: check warning: b should start with 'potato'. +d = "not Diego" + ^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:7: check warning: d should start with D { - "Bar": { - "a": "potato", - "b": "kitten", - "c": 1 + "All_Regex_Matches": { + "a": "123abc", + "b": "3_kitten_", + "c": "potato and tomato sauce", + "d": "Diego" + }, + "No_Regex_Matches": { + "a": "123456789 abcdefghijklmn", + "b": "??...kitten_...??", + "c": "not potato", + "d": "not Diego" } } -Processed 1 model and 1 requirement file and found no issues +Processed 1 model and 1 requirement file and found 4 warnings diff --git a/tests-system/rbt-matches-semantics/output.smtlib b/tests-system/rbt-matches-semantics/output.smtlib index a36e3bac..6eca8c36 100644 --- a/tests-system/rbt-matches-semantics/output.smtlib +++ b/tests-system/rbt-matches-semantics/output.smtlib @@ -1 +1,9 @@ -Processed 1 model and 1 requirement file and found no issues +a = "123456789 abcdefghijklmn" + ^^^^^^^^^^^^^^^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:4: check warning: a should match with 6 to 12 letters or digits +b = "??...kitten_...??" + ^^^^^^^^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:5: check warning: b should match only letters, digits, or underscores. +c = "not potato" + ^^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:6: check warning: b should start with 'potato'. +d = "not Diego" + ^^^^^^^^^^^ rbt-matches-semantics/foo.trlc:7: check warning: d should start with D +Processed 1 model and 1 requirement file and found 4 warnings diff --git a/tests-system/rbt-signature-len-1/foo.rsl b/tests-system/rbt-signature-len-1/foo.rsl index 353b0a6d..42a2add5 100644 --- a/tests-system/rbt-signature-len-1/foo.rsl +++ b/tests-system/rbt-signature-len-1/foo.rsl @@ -3,7 +3,6 @@ package Foo type T { a String b Integer - c Integer[1..*] } checks T { diff --git a/tests-system/rbt-signature-len-1/output b/tests-system/rbt-signature-len-1/output index c752dc91..90aad6f0 100644 --- a/tests-system/rbt-signature-len-1/output +++ b/tests-system/rbt-signature-len-1/output @@ -1,3 +1,3 @@ len(b) > 7, "b must be longer than 7" - ^ rbt-signature-len-1/foo.rsl:11: error: expected expression of type Array_Type, got Builtin_Integer instead + ^ rbt-signature-len-1/foo.rsl:10: error: expected expression of type Array_Type, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-len-1/output.brief b/tests-system/rbt-signature-len-1/output.brief index ec522560..76483632 100644 --- a/tests-system/rbt-signature-len-1/output.brief +++ b/tests-system/rbt-signature-len-1/output.brief @@ -1 +1 @@ -rbt-signature-len-1/foo.rsl:11:9: trlc error: expected expression of type Array_Type, got Builtin_Integer instead +rbt-signature-len-1/foo.rsl:10:9: trlc error: expected expression of type Array_Type, got Builtin_Integer instead diff --git a/tests-system/rbt-signature-len-1/output.json b/tests-system/rbt-signature-len-1/output.json index c752dc91..90aad6f0 100644 --- a/tests-system/rbt-signature-len-1/output.json +++ b/tests-system/rbt-signature-len-1/output.json @@ -1,3 +1,3 @@ len(b) > 7, "b must be longer than 7" - ^ rbt-signature-len-1/foo.rsl:11: error: expected expression of type Array_Type, got Builtin_Integer instead + ^ rbt-signature-len-1/foo.rsl:10: error: expected expression of type Array_Type, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-len-1/output.smtlib b/tests-system/rbt-signature-len-1/output.smtlib index c752dc91..90aad6f0 100644 --- a/tests-system/rbt-signature-len-1/output.smtlib +++ b/tests-system/rbt-signature-len-1/output.smtlib @@ -1,3 +1,3 @@ len(b) > 7, "b must be longer than 7" - ^ rbt-signature-len-1/foo.rsl:11: error: expected expression of type Array_Type, got Builtin_Integer instead + ^ rbt-signature-len-1/foo.rsl:10: error: expected expression of type Array_Type, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-len-2/foo.rsl b/tests-system/rbt-signature-len-2/foo.rsl index af918e07..d2478194 100644 --- a/tests-system/rbt-signature-len-2/foo.rsl +++ b/tests-system/rbt-signature-len-2/foo.rsl @@ -2,7 +2,6 @@ package Foo type T { a String - b Integer c Integer[1..*] } diff --git a/tests-system/rbt-signature-len-2/foo.trlc b/tests-system/rbt-signature-len-2/foo.trlc index f3bd6ce1..354b3682 100644 --- a/tests-system/rbt-signature-len-2/foo.trlc +++ b/tests-system/rbt-signature-len-2/foo.trlc @@ -2,6 +2,5 @@ package Foo T Bar { a = "potato" - b = 1 c = [2,1] } diff --git a/tests-system/rbt-signature-len-2/output b/tests-system/rbt-signature-len-2/output index 5a01f12e..f21b60fb 100644 --- a/tests-system/rbt-signature-len-2/output +++ b/tests-system/rbt-signature-len-2/output @@ -1,3 +1,3 @@ len(a, c) > 7, "a and c must be longer than 7" -^^^ rbt-signature-len-2/foo.rsl:12: error: function requires 1 parameters +^^^ rbt-signature-len-2/foo.rsl:11: error: function requires 1 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-len-2/output.brief b/tests-system/rbt-signature-len-2/output.brief index 58e08a15..3fb8f578 100644 --- a/tests-system/rbt-signature-len-2/output.brief +++ b/tests-system/rbt-signature-len-2/output.brief @@ -1 +1 @@ -rbt-signature-len-2/foo.rsl:12:5: trlc error: function requires 1 parameters +rbt-signature-len-2/foo.rsl:11:5: trlc error: function requires 1 parameters diff --git a/tests-system/rbt-signature-len-2/output.json b/tests-system/rbt-signature-len-2/output.json index 5a01f12e..f21b60fb 100644 --- a/tests-system/rbt-signature-len-2/output.json +++ b/tests-system/rbt-signature-len-2/output.json @@ -1,3 +1,3 @@ len(a, c) > 7, "a and c must be longer than 7" -^^^ rbt-signature-len-2/foo.rsl:12: error: function requires 1 parameters +^^^ rbt-signature-len-2/foo.rsl:11: error: function requires 1 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-len-2/output.smtlib b/tests-system/rbt-signature-len-2/output.smtlib index 5a01f12e..f21b60fb 100644 --- a/tests-system/rbt-signature-len-2/output.smtlib +++ b/tests-system/rbt-signature-len-2/output.smtlib @@ -1,3 +1,3 @@ len(a, c) > 7, "a and c must be longer than 7" -^^^ rbt-signature-len-2/foo.rsl:12: error: function requires 1 parameters +^^^ rbt-signature-len-2/foo.rsl:11: error: function requires 1 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-matches-1/foo.rsl b/tests-system/rbt-signature-matches-1/foo.rsl index abd2d622..fa46af47 100644 --- a/tests-system/rbt-signature-matches-1/foo.rsl +++ b/tests-system/rbt-signature-matches-1/foo.rsl @@ -1,8 +1,6 @@ package Foo type T { - a String - b String c Integer } diff --git a/tests-system/rbt-signature-matches-1/output b/tests-system/rbt-signature-matches-1/output index 399804df..35155c1b 100644 --- a/tests-system/rbt-signature-matches-1/output +++ b/tests-system/rbt-signature-matches-1/output @@ -1,3 +1,3 @@ matches(c, "potato"), warning "a should match with potato", a - ^ rbt-signature-matches-1/foo.rsl:10: error: expected expression of type Builtin_String, got Builtin_Integer instead + ^ rbt-signature-matches-1/foo.rsl:8: error: expected expression of type Builtin_String, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-matches-1/output.brief b/tests-system/rbt-signature-matches-1/output.brief index 97880a4d..576463a3 100644 --- a/tests-system/rbt-signature-matches-1/output.brief +++ b/tests-system/rbt-signature-matches-1/output.brief @@ -1 +1 @@ -rbt-signature-matches-1/foo.rsl:10:13: trlc error: expected expression of type Builtin_String, got Builtin_Integer instead +rbt-signature-matches-1/foo.rsl:8:13: trlc error: expected expression of type Builtin_String, got Builtin_Integer instead diff --git a/tests-system/rbt-signature-matches-1/output.json b/tests-system/rbt-signature-matches-1/output.json index 399804df..35155c1b 100644 --- a/tests-system/rbt-signature-matches-1/output.json +++ b/tests-system/rbt-signature-matches-1/output.json @@ -1,3 +1,3 @@ matches(c, "potato"), warning "a should match with potato", a - ^ rbt-signature-matches-1/foo.rsl:10: error: expected expression of type Builtin_String, got Builtin_Integer instead + ^ rbt-signature-matches-1/foo.rsl:8: error: expected expression of type Builtin_String, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-matches-1/output.smtlib b/tests-system/rbt-signature-matches-1/output.smtlib index 399804df..35155c1b 100644 --- a/tests-system/rbt-signature-matches-1/output.smtlib +++ b/tests-system/rbt-signature-matches-1/output.smtlib @@ -1,3 +1,3 @@ matches(c, "potato"), warning "a should match with potato", a - ^ rbt-signature-matches-1/foo.rsl:10: error: expected expression of type Builtin_String, got Builtin_Integer instead + ^ rbt-signature-matches-1/foo.rsl:8: error: expected expression of type Builtin_String, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-matches-2/foo.rsl b/tests-system/rbt-signature-matches-2/foo.rsl index ed1a976f..e97a8da9 100644 --- a/tests-system/rbt-signature-matches-2/foo.rsl +++ b/tests-system/rbt-signature-matches-2/foo.rsl @@ -3,7 +3,6 @@ package Foo type T { a String b String - c Integer } checks T { diff --git a/tests-system/rbt-signature-matches-2/foo.trlc b/tests-system/rbt-signature-matches-2/foo.trlc index 71700516..c0877585 100644 --- a/tests-system/rbt-signature-matches-2/foo.trlc +++ b/tests-system/rbt-signature-matches-2/foo.trlc @@ -3,5 +3,4 @@ package Foo T Bar { a = "potato" b = "kitten" - c = 1 } diff --git a/tests-system/rbt-signature-matches-2/output b/tests-system/rbt-signature-matches-2/output index a31ebfd3..279c2817 100644 --- a/tests-system/rbt-signature-matches-2/output +++ b/tests-system/rbt-signature-matches-2/output @@ -1,3 +1,3 @@ matches(a, b, "potato"), warning "a should match with potato", a -^^^^^^^ rbt-signature-matches-2/foo.rsl:10: error: function requires 2 parameters +^^^^^^^ rbt-signature-matches-2/foo.rsl:9: error: function requires 2 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-matches-2/output.brief b/tests-system/rbt-signature-matches-2/output.brief index 3d364487..fc818813 100644 --- a/tests-system/rbt-signature-matches-2/output.brief +++ b/tests-system/rbt-signature-matches-2/output.brief @@ -1 +1 @@ -rbt-signature-matches-2/foo.rsl:10:5: trlc error: function requires 2 parameters +rbt-signature-matches-2/foo.rsl:9:5: trlc error: function requires 2 parameters diff --git a/tests-system/rbt-signature-matches-2/output.json b/tests-system/rbt-signature-matches-2/output.json index a31ebfd3..279c2817 100644 --- a/tests-system/rbt-signature-matches-2/output.json +++ b/tests-system/rbt-signature-matches-2/output.json @@ -1,3 +1,3 @@ matches(a, b, "potato"), warning "a should match with potato", a -^^^^^^^ rbt-signature-matches-2/foo.rsl:10: error: function requires 2 parameters +^^^^^^^ rbt-signature-matches-2/foo.rsl:9: error: function requires 2 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-matches-2/output.smtlib b/tests-system/rbt-signature-matches-2/output.smtlib index a31ebfd3..279c2817 100644 --- a/tests-system/rbt-signature-matches-2/output.smtlib +++ b/tests-system/rbt-signature-matches-2/output.smtlib @@ -1,3 +1,3 @@ matches(a, b, "potato"), warning "a should match with potato", a -^^^^^^^ rbt-signature-matches-2/foo.rsl:10: error: function requires 2 parameters +^^^^^^^ rbt-signature-matches-2/foo.rsl:9: error: function requires 2 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-matches-3/foo.rsl b/tests-system/rbt-signature-matches-3/foo.rsl index e30fd895..923237a8 100644 --- a/tests-system/rbt-signature-matches-3/foo.rsl +++ b/tests-system/rbt-signature-matches-3/foo.rsl @@ -7,5 +7,5 @@ type T { } checks T { - matches(a, "(abc(def)"), warning "a should match with potato", a + matches(a, "(abc(def)"), warning "a should match with the regex (abc(def))", a } diff --git a/tests-system/rbt-signature-matches-3/output b/tests-system/rbt-signature-matches-3/output index 16cec378..e542ac97 100644 --- a/tests-system/rbt-signature-matches-3/output +++ b/tests-system/rbt-signature-matches-3/output @@ -1,3 +1,3 @@ -matches(a, "(abc(def)"), warning "a should match with potato", a +matches(a, "(abc(def)"), warning "a should match with the regex (abc(def))", a ^^^^^^^^^^^ rbt-signature-matches-3/foo.rsl:10: error: missing ), unterminated subpattern at position 0 Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-matches-3/output.json b/tests-system/rbt-signature-matches-3/output.json index 16cec378..e542ac97 100644 --- a/tests-system/rbt-signature-matches-3/output.json +++ b/tests-system/rbt-signature-matches-3/output.json @@ -1,3 +1,3 @@ -matches(a, "(abc(def)"), warning "a should match with potato", a +matches(a, "(abc(def)"), warning "a should match with the regex (abc(def))", a ^^^^^^^^^^^ rbt-signature-matches-3/foo.rsl:10: error: missing ), unterminated subpattern at position 0 Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-matches-3/output.smtlib b/tests-system/rbt-signature-matches-3/output.smtlib index 16cec378..e542ac97 100644 --- a/tests-system/rbt-signature-matches-3/output.smtlib +++ b/tests-system/rbt-signature-matches-3/output.smtlib @@ -1,3 +1,3 @@ -matches(a, "(abc(def)"), warning "a should match with potato", a +matches(a, "(abc(def)"), warning "a should match with the regex (abc(def))", a ^^^^^^^^^^^ rbt-signature-matches-3/foo.rsl:10: error: missing ), unterminated subpattern at position 0 Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-1/foo.rsl b/tests-system/rbt-signature-string-end-functions-1/foo.rsl index 48e28213..c20c6f2b 100644 --- a/tests-system/rbt-signature-string-end-functions-1/foo.rsl +++ b/tests-system/rbt-signature-string-end-functions-1/foo.rsl @@ -2,13 +2,10 @@ package Foo type T { a String - b String c Integer } checks T { startswith(a, "po"), warning "a should start with po", a - startswith(b, "po"), warning "b should start with po", b - endswith(c, "en"), warning "a should end with en", c - endswith(b, "en"), warning "b should end with en", b + startswith(c, "po"), warning "b should start with po", b } diff --git a/tests-system/rbt-signature-string-end-functions-1/output b/tests-system/rbt-signature-string-end-functions-1/output index 3914fdbb..b26ced98 100644 --- a/tests-system/rbt-signature-string-end-functions-1/output +++ b/tests-system/rbt-signature-string-end-functions-1/output @@ -1,3 +1,3 @@ -endswith(c, "en"), warning "a should end with en", c - ^ rbt-signature-string-end-functions-1/foo.rsl:12: error: expected expression of type Builtin_String, got Builtin_Integer instead +startswith(c, "po"), warning "b should start with po", b + ^ rbt-signature-string-end-functions-1/foo.rsl:10: error: expected expression of type Builtin_String, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-1/output.brief b/tests-system/rbt-signature-string-end-functions-1/output.brief index b4c1b3b0..d164f6d9 100644 --- a/tests-system/rbt-signature-string-end-functions-1/output.brief +++ b/tests-system/rbt-signature-string-end-functions-1/output.brief @@ -1 +1 @@ -rbt-signature-string-end-functions-1/foo.rsl:12:14: trlc error: expected expression of type Builtin_String, got Builtin_Integer instead +rbt-signature-string-end-functions-1/foo.rsl:10:16: trlc error: expected expression of type Builtin_String, got Builtin_Integer instead diff --git a/tests-system/rbt-signature-string-end-functions-1/output.json b/tests-system/rbt-signature-string-end-functions-1/output.json index 3914fdbb..b26ced98 100644 --- a/tests-system/rbt-signature-string-end-functions-1/output.json +++ b/tests-system/rbt-signature-string-end-functions-1/output.json @@ -1,3 +1,3 @@ -endswith(c, "en"), warning "a should end with en", c - ^ rbt-signature-string-end-functions-1/foo.rsl:12: error: expected expression of type Builtin_String, got Builtin_Integer instead +startswith(c, "po"), warning "b should start with po", b + ^ rbt-signature-string-end-functions-1/foo.rsl:10: error: expected expression of type Builtin_String, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-1/output.smtlib b/tests-system/rbt-signature-string-end-functions-1/output.smtlib index 3914fdbb..b26ced98 100644 --- a/tests-system/rbt-signature-string-end-functions-1/output.smtlib +++ b/tests-system/rbt-signature-string-end-functions-1/output.smtlib @@ -1,3 +1,3 @@ -endswith(c, "en"), warning "a should end with en", c - ^ rbt-signature-string-end-functions-1/foo.rsl:12: error: expected expression of type Builtin_String, got Builtin_Integer instead +startswith(c, "po"), warning "b should start with po", b + ^ rbt-signature-string-end-functions-1/foo.rsl:10: error: expected expression of type Builtin_String, got Builtin_Integer instead Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-2/foo.rsl b/tests-system/rbt-signature-string-end-functions-2/foo.rsl index 19c6e27d..083dc52e 100644 --- a/tests-system/rbt-signature-string-end-functions-2/foo.rsl +++ b/tests-system/rbt-signature-string-end-functions-2/foo.rsl @@ -3,7 +3,6 @@ package Foo type T { a String b String - c Integer } checks T { diff --git a/tests-system/rbt-signature-string-end-functions-2/foo.trlc b/tests-system/rbt-signature-string-end-functions-2/foo.trlc index 71700516..c0877585 100644 --- a/tests-system/rbt-signature-string-end-functions-2/foo.trlc +++ b/tests-system/rbt-signature-string-end-functions-2/foo.trlc @@ -3,5 +3,4 @@ package Foo T Bar { a = "potato" b = "kitten" - c = 1 } diff --git a/tests-system/rbt-signature-string-end-functions-2/output b/tests-system/rbt-signature-string-end-functions-2/output index 595f67df..d26dbcc3 100644 --- a/tests-system/rbt-signature-string-end-functions-2/output +++ b/tests-system/rbt-signature-string-end-functions-2/output @@ -1,3 +1,3 @@ endswith(a, b, "en"), warning "b should end with en", b -^^^^^^^^ rbt-signature-string-end-functions-2/foo.rsl:13: error: function requires 2 parameters +^^^^^^^^ rbt-signature-string-end-functions-2/foo.rsl:12: error: function requires 2 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-2/output.brief b/tests-system/rbt-signature-string-end-functions-2/output.brief index 57483f2e..94df5f3e 100644 --- a/tests-system/rbt-signature-string-end-functions-2/output.brief +++ b/tests-system/rbt-signature-string-end-functions-2/output.brief @@ -1 +1 @@ -rbt-signature-string-end-functions-2/foo.rsl:13:5: trlc error: function requires 2 parameters +rbt-signature-string-end-functions-2/foo.rsl:12:5: trlc error: function requires 2 parameters diff --git a/tests-system/rbt-signature-string-end-functions-2/output.json b/tests-system/rbt-signature-string-end-functions-2/output.json index 595f67df..d26dbcc3 100644 --- a/tests-system/rbt-signature-string-end-functions-2/output.json +++ b/tests-system/rbt-signature-string-end-functions-2/output.json @@ -1,3 +1,3 @@ endswith(a, b, "en"), warning "b should end with en", b -^^^^^^^^ rbt-signature-string-end-functions-2/foo.rsl:13: error: function requires 2 parameters +^^^^^^^^ rbt-signature-string-end-functions-2/foo.rsl:12: error: function requires 2 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-2/output.smtlib b/tests-system/rbt-signature-string-end-functions-2/output.smtlib index 595f67df..d26dbcc3 100644 --- a/tests-system/rbt-signature-string-end-functions-2/output.smtlib +++ b/tests-system/rbt-signature-string-end-functions-2/output.smtlib @@ -1,3 +1,3 @@ endswith(a, b, "en"), warning "b should end with en", b -^^^^^^^^ rbt-signature-string-end-functions-2/foo.rsl:13: error: function requires 2 parameters +^^^^^^^^ rbt-signature-string-end-functions-2/foo.rsl:12: error: function requires 2 parameters Processed 1 model and 1 requirement file and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-3/foo.rsl b/tests-system/rbt-signature-string-end-functions-3/foo.rsl new file mode 100644 index 00000000..b716322f --- /dev/null +++ b/tests-system/rbt-signature-string-end-functions-3/foo.rsl @@ -0,0 +1,11 @@ +package Foo + +type T { + b String + c Integer +} + +checks T { + endswith(c, "en"), warning "a should end with en", c + endswith(b, "en"), warning "b should end with en", b +} diff --git a/tests-system/rbt-signature-string-end-functions-3/output b/tests-system/rbt-signature-string-end-functions-3/output new file mode 100644 index 00000000..7fc30467 --- /dev/null +++ b/tests-system/rbt-signature-string-end-functions-3/output @@ -0,0 +1,3 @@ +endswith(c, "en"), warning "a should end with en", c + ^ rbt-signature-string-end-functions-3/foo.rsl:9: error: expected expression of type Builtin_String, got Builtin_Integer instead +Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-3/output.brief b/tests-system/rbt-signature-string-end-functions-3/output.brief new file mode 100644 index 00000000..2eb9abb5 --- /dev/null +++ b/tests-system/rbt-signature-string-end-functions-3/output.brief @@ -0,0 +1 @@ +rbt-signature-string-end-functions-3/foo.rsl:9:14: trlc error: expected expression of type Builtin_String, got Builtin_Integer instead diff --git a/tests-system/rbt-signature-string-end-functions-3/output.json b/tests-system/rbt-signature-string-end-functions-3/output.json new file mode 100644 index 00000000..7fc30467 --- /dev/null +++ b/tests-system/rbt-signature-string-end-functions-3/output.json @@ -0,0 +1,3 @@ +endswith(c, "en"), warning "a should end with en", c + ^ rbt-signature-string-end-functions-3/foo.rsl:9: error: expected expression of type Builtin_String, got Builtin_Integer instead +Processed 1 model and 0 requirement files and found 1 error diff --git a/tests-system/rbt-signature-string-end-functions-3/output.smtlib b/tests-system/rbt-signature-string-end-functions-3/output.smtlib new file mode 100644 index 00000000..7fc30467 --- /dev/null +++ b/tests-system/rbt-signature-string-end-functions-3/output.smtlib @@ -0,0 +1,3 @@ +endswith(c, "en"), warning "a should end with en", c + ^ rbt-signature-string-end-functions-3/foo.rsl:9: error: expected expression of type Builtin_String, got Builtin_Integer instead +Processed 1 model and 0 requirement files and found 1 error