Skip to content

Commit

Permalink
remove deprecated feature: check files
Browse files Browse the repository at this point in the history
  • Loading branch information
ankushsonare1 committed Mar 20, 2024
1 parent 26645ea commit facb784
Show file tree
Hide file tree
Showing 62 changed files with 128 additions and 271 deletions.
10 changes: 10 additions & 0 deletions tests-system/base-types/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@


}

checks MyType {


int_ok == 42, error "int must be 42", int_ok
int_nok == 42, error "int must be 42", int_nok
int_null == null, error "int must be null", int_null


}
12 changes: 0 additions & 12 deletions tests-system/base-types/checks.check

This file was deleted.

4 changes: 4 additions & 0 deletions tests-system/check-wo-type/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ type MyType {
status Status

}
checks {
status == bar.Status.NEW , error "Status must be NEW"
}

5 changes: 0 additions & 5 deletions tests-system/check-wo-type/checks.check

This file was deleted.

5 changes: 0 additions & 5 deletions tests-system/checks-1/foo.check

This file was deleted.

4 changes: 4 additions & 0 deletions tests-system/checks-1/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ type T {
a Integer
b optional Integer
}
checks T {
a < b, "a must be less than b"
}

6 changes: 0 additions & 6 deletions tests-system/checks-2/foo.check

This file was deleted.

5 changes: 5 additions & 0 deletions tests-system/checks-2/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ type T {
a Integer
b optional Integer
}

checks T {
b != null, fatal "please define b", b
a < b, "a must be less than b", a
}
5 changes: 0 additions & 5 deletions tests-system/checks-3/foo.check

This file was deleted.

4 changes: 4 additions & 0 deletions tests-system/checks-3/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ type T {
a Integer
b optional Integer
}

checks T {
b != null implies a < b, "a must be less than b", a
}
5 changes: 0 additions & 5 deletions tests-system/checks-4/foo.check

This file was deleted.

3 changes: 3 additions & 0 deletions tests-system/checks-4/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ type T {
foo optional String
values optional String [2 .. 5]
}
checks T {
(forall v in values => v != foo), "value cannot be same as value of foo", values
}
4 changes: 4 additions & 0 deletions tests-system/empty-attributes/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ enum ASIL {
C
D
}
checks BaseRequirement {
asil != null, error "Asil must be set", asil

}



Expand Down
6 changes: 0 additions & 6 deletions tests-system/empty-attributes/checks.check

This file was deleted.

3 changes: 3 additions & 0 deletions tests-system/enum-null/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ type MyType {
status optional Status

}
checks MyType {
status != null , "Status must be not null"
}
5 changes: 0 additions & 5 deletions tests-system/enum-null/checks.check

This file was deleted.

4 changes: 4 additions & 0 deletions tests-system/enum-ok/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ type MyType {
status Status

}

checks MyType {
bar.Status.NEW == status , "Status must be NEW"
}
6 changes: 0 additions & 6 deletions tests-system/enum-ok/checks.check

This file was deleted.

4 changes: 4 additions & 0 deletions tests-system/enum/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ type MyType {
status Status

}
checks MyType {
status == bar.Status.NEW , "Status must be NEW"
status != null , "Internal error when evaluating enum value"
}
5 changes: 0 additions & 5 deletions tests-system/enum/checks.check

This file was deleted.

4 changes: 4 additions & 0 deletions tests-system/error-in-check/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
type MyType {
name String
}

checks MyType {
startsXwith(name, "Q"), error "name must start with Q", name
}
5 changes: 0 additions & 5 deletions tests-system/error-in-check/checks.check

This file was deleted.

5 changes: 5 additions & 0 deletions tests-system/inheritance-2/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
name String
length Integer
}
checks MyType {
name != null and len(name) == length, "name must have specific length" , name
}




type Type2 extends MyType {
Expand Down
5 changes: 0 additions & 5 deletions tests-system/inheritance-2/checks.check

This file was deleted.

5 changes: 4 additions & 1 deletion tests-system/inheritance/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@

type Type2 extends bar.MyType {
length Integer
}
}
checks Type2 {
len(name) == length, error "name must have specific length" , name
}
5 changes: 0 additions & 5 deletions tests-system/inheritance/checks.check

This file was deleted.

6 changes: 5 additions & 1 deletion tests-system/mult/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ type MyType {
name String
mult String [3..5]

}
}

checks MyType {
len(mult) == 3, "mult must have 3 elements"
}
5 changes: 0 additions & 5 deletions tests-system/mult/checks.check

This file was deleted.

5 changes: 5 additions & 0 deletions tests-system/multiple-check-expressions/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
type MyType {
name String
}
checks MyType {
startswith(name, "Q"), "name must start with Q", name
endswith(name, "t"), "name must end with t", name
}

6 changes: 0 additions & 6 deletions tests-system/multiple-check-expressions/checks.check

This file was deleted.

5 changes: 0 additions & 5 deletions tests-system/multiple-models/bar.check

This file was deleted.

3 changes: 3 additions & 0 deletions tests-system/multiple-models/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ import Foo

type T extends Foo.T {
}
checks T {
endswith(name, "kitten"), "also not a good name"
}
5 changes: 0 additions & 5 deletions tests-system/multiple-models/foo.check

This file was deleted.

4 changes: 4 additions & 0 deletions tests-system/multiple-models/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ package Foo
type T {
name String
}

checks T {
startswith(name, "potato"), "this is not a good name"
}
5 changes: 5 additions & 0 deletions tests-system/null-value/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
name String
other MyType
}
checks MyType {
other != null , "Other must not be null", other
other == null , "Other must be null", other
}

6 changes: 0 additions & 6 deletions tests-system/null-value/checks.check

This file was deleted.

3 changes: 3 additions & 0 deletions tests-system/redefined-attribute/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ type MyType {
type MyType2 extends MyType {
middle optional String
}
checks MyType {
startswith(name, "Q"), "name must start with Q", name
}

type MyType3 extends MyType2 {

Expand Down
4 changes: 0 additions & 4 deletions tests-system/redefined-attribute/checks.check

This file was deleted.

6 changes: 6 additions & 0 deletions tests-system/simple-info-warn-error/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
type MyType {
name optional String
}
checks MyType {
matches(name, "^D.*"), error "name must start with D", name
matches(name, "^E.*"), error "name must start with E", name
matches(name, "^W.*"), warning "name must start with W", name
matches(name, "^I.*"), warning "name must start with I", name
}
8 changes: 0 additions & 8 deletions tests-system/simple-info-warn-error/checks.check

This file was deleted.

3 changes: 3 additions & 0 deletions tests-system/simple-more-than-one/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
type MyType {
name optional String
}
checks MyType {
matches(name, "^Q.*"), error "name must start with Q", name
}
5 changes: 0 additions & 5 deletions tests-system/simple-more-than-one/checks.check

This file was deleted.

3 changes: 3 additions & 0 deletions tests-system/simple/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ package bar
type MyType {
name String
}
checks MyType {
len(name) > 1, "name must start with Q", name
}
5 changes: 0 additions & 5 deletions tests-system/simple/checks.check

This file was deleted.

5 changes: 0 additions & 5 deletions tests-system/strings/foo.check

This file was deleted.

3 changes: 3 additions & 0 deletions tests-system/strings/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ type T {
txt String
len Integer
}
checks T {
len (txt) == len, warning "length is not as expected", len
}
10 changes: 0 additions & 10 deletions tests-system/tutorial-2/example.check

This file was deleted.

8 changes: 8 additions & 0 deletions tests-system/tutorial-2/example.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ type Requirement {
functional Boolean
integrity optional ASIL
}
checks Requirement {
functional implies integrity != null,
error "a functional requirement requires an integrity"

integrity == ASIL.D implies len (description) > 10,
warning "this is not very descriptive",
description
}
3 changes: 3 additions & 0 deletions tests-system/value-exact/bar.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
type MyType {
name optional String
}
checks MyType {
name != null and name == "Qbert", error "name must be 'Qbert'", name
}
6 changes: 0 additions & 6 deletions tests-system/value-exact/checks.check

This file was deleted.

Loading

0 comments on commit facb784

Please sign in to comment.