Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement review comments from PR #66 #109

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests-system/rbt-endswith-semantics/foo.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ package Foo
T Bar {
b = "kitten"
}

T Baz {
b = "dog"
}
4 changes: 3 additions & 1 deletion tests-system/rbt-endswith-semantics/output
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tests-system/rbt-endswith-semantics/output.brief
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rbt-endswith-semantics/foo.trlc:8:9: trlc check warning: b should end with en
7 changes: 6 additions & 1 deletion tests-system/rbt-endswith-semantics/output.json
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion tests-system/rbt-endswith-semantics/output.smtlib
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion tests-system/rbt-len-semantics/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package Foo

type T {
a String
b Integer
c Integer[1..*]
}

Expand Down
1 change: 0 additions & 1 deletion tests-system/rbt-len-semantics/foo.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ package Foo

T Bar {
a = "potato"
b = 1
c = [2,1]
}
1 change: 0 additions & 1 deletion tests-system/rbt-len-semantics/output.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"Bar": {
"a": "potato",
"b": 1,
"c": [
2,
1
Expand Down
8 changes: 6 additions & 2 deletions tests-system/rbt-matches-semantics/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
16 changes: 12 additions & 4 deletions tests-system/rbt-matches-semantics/foo.trlc
Original file line number Diff line number Diff line change
@@ -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"
}
10 changes: 9 additions & 1 deletion tests-system/rbt-matches-semantics/output
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tests-system/rbt-matches-semantics/output.brief
Original file line number Diff line number Diff line change
@@ -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
25 changes: 20 additions & 5 deletions tests-system/rbt-matches-semantics/output.json
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion tests-system/rbt-matches-semantics/output.smtlib
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion tests-system/rbt-signature-len-1/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package Foo
type T {
a String
b Integer
c Integer[1..*]
}

checks T {
Expand Down
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-len-1/output
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-len-1/output.brief
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-len-1/output.json
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-len-1/output.smtlib
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion tests-system/rbt-signature-len-2/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package Foo

type T {
a String
b Integer
c Integer[1..*]
}

Expand Down
1 change: 0 additions & 1 deletion tests-system/rbt-signature-len-2/foo.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ package Foo

T Bar {
a = "potato"
b = 1
c = [2,1]
}
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-len-2/output
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-len-2/output.brief
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-len-2/output.json
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-len-2/output.smtlib
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions tests-system/rbt-signature-matches-1/foo.rsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package Foo

type T {
a String
b String
c Integer
}

Expand Down
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-1/output
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-1/output.brief
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-1/output.json
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-1/output.smtlib
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion tests-system/rbt-signature-matches-2/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package Foo
type T {
a String
b String
c Integer
}

checks T {
Expand Down
1 change: 0 additions & 1 deletion tests-system/rbt-signature-matches-2/foo.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ package Foo
T Bar {
a = "potato"
b = "kitten"
c = 1
}
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-2/output
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-2/output.brief
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-2/output.json
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-2/output.smtlib
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-3/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-3/output
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-3/output.json
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-matches-3/output.smtlib
Original file line number Diff line number Diff line change
@@ -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
5 changes: 1 addition & 4 deletions tests-system/rbt-signature-string-end-functions-1/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions tests-system/rbt-signature-string-end-functions-1/output
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package Foo
type T {
a String
b String
c Integer
}

checks T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ package Foo
T Bar {
a = "potato"
b = "kitten"
c = 1
}
2 changes: 1 addition & 1 deletion tests-system/rbt-signature-string-end-functions-2/output
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions tests-system/rbt-signature-string-end-functions-3/foo.rsl
Original file line number Diff line number Diff line change
@@ -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
}
3 changes: 3 additions & 0 deletions tests-system/rbt-signature-string-end-functions-3/output
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Loading