8
8
/*
9
9
==================================================================
10
10
First created on: Mar/28/2021
11
- Last modified on: June/01 /2021
11
+ Last modified on: June/07 /2021
12
12
13
13
This application is meant for doing several hundred
14
14
functional tests to provide as much coverage as possible to
@@ -6768,11 +6768,13 @@ composite FunctionalTests {
6768
6768
}
6769
6769
// -------------------------
6770
6770
6771
- // A54.1 (Use of in for membership test.)
6771
+ // A54.1 (Use of in for rstring membership test.)
6772
6772
// It does case sensitive membership test using a list literal string.
6773
- type Role_t = rstring role, int32 x , float64 y ;
6773
+ type Role_t = rstring role, int32 age , float64 salary ;
6774
6774
mutable Role_t myRole = {};
6775
6775
myRole.role = "Admin";
6776
+ myRole.age = 56;
6777
+ myRole.salary = 10514.00;
6776
6778
6777
6779
_rule = 'role in ["Developer", "Tester", "Admin", "Manager"]';
6778
6780
result = eval_predicate(_rule, myRole, error, $EVAL_PREDICATE_TRACING);
@@ -6785,11 +6787,10 @@ composite FunctionalTests {
6785
6787
printStringLn("Testcase A54.1: Evaluation execution failed. Error=" + (rstring)error);
6786
6788
}
6787
6789
6788
- // A54.2 (Use of inCI for membership test.)
6790
+ // A54.2 (Use of inCI for rstring membership test.)
6789
6791
// It does case insensitive membership test using a list literal string.
6790
6792
myRole.role = "mAnAgEr";
6791
6793
_rule = 'role inCI ["Developer", "Tester", "Admin", "Manager"]';
6792
-
6793
6794
result = eval_predicate(_rule, myRole, error, $EVAL_PREDICATE_TRACING);
6794
6795
6795
6796
if(result == true) {
@@ -6799,6 +6800,58 @@ composite FunctionalTests {
6799
6800
} else {
6800
6801
printStringLn("Testcase A54.2: Evaluation execution failed. Error=" + (rstring)error);
6801
6802
}
6803
+
6804
+ // A54.3 (Use of in for int32 membership test.)
6805
+ // It does membership test using a list literal string.
6806
+ _rule = 'age in [22, 40, 43, 50, 56, 65]';
6807
+ result = eval_predicate(_rule, myRole, error, $EVAL_PREDICATE_TRACING);
6808
+
6809
+ if(result == true) {
6810
+ printStringLn("Testcase A54.3: Evaluation criteria is met.");
6811
+ } else if(result == false && error == 0) {
6812
+ printStringLn("Testcase A54.3: Evaluation criteria is not met.");
6813
+ } else {
6814
+ printStringLn("Testcase A54.3: Evaluation execution failed. Error=" + (rstring)error);
6815
+ }
6816
+
6817
+ // A54.4 (Use of in for float64 membership test.)
6818
+ // It does membership test using a list literal string.
6819
+ _rule = 'salary in [68326.45, 92821.87, 10514.00, 120529,32]';
6820
+ result = eval_predicate(_rule, myRole, error, $EVAL_PREDICATE_TRACING);
6821
+
6822
+ if(result == true) {
6823
+ printStringLn("Testcase A54.4: Evaluation criteria is met.");
6824
+ } else if(result == false && error == 0) {
6825
+ printStringLn("Testcase A54.4: Evaluation criteria is not met.");
6826
+ } else {
6827
+ printStringLn("Testcase A54.4: Evaluation execution failed. Error=" + (rstring)error);
6828
+ }
6829
+
6830
+ // A54.5 (Use of in for int32 membership test.)
6831
+ // It does membership test using a list literal string.
6832
+ _rule = 'age in [22, 40, 43, 50, 58, 65]';
6833
+ result = eval_predicate(_rule, myRole, error, $EVAL_PREDICATE_TRACING);
6834
+
6835
+ if(result == true) {
6836
+ printStringLn("Testcase A54.5: Evaluation criteria is met.");
6837
+ } else if(result == false && error == 0) {
6838
+ printStringLn("Testcase A54.5: Evaluation criteria is not met.");
6839
+ } else {
6840
+ printStringLn("Testcase A54.5: Evaluation execution failed. Error=" + (rstring)error);
6841
+ }
6842
+
6843
+ // A54.6 (Use of in for float64 membership test.)
6844
+ // It does membership test using a list literal string.
6845
+ _rule = 'salary in [68326.45, 92821.87, 10594.76, 120529,32]';
6846
+ result = eval_predicate(_rule, myRole, error, $EVAL_PREDICATE_TRACING);
6847
+
6848
+ if(result == true) {
6849
+ printStringLn("Testcase A54.6: Evaluation criteria is met.");
6850
+ } else if(result == false && error == 0) {
6851
+ printStringLn("Testcase A54.6: Evaluation criteria is not met.");
6852
+ } else {
6853
+ printStringLn("Testcase A54.6: Evaluation execution failed. Error=" + (rstring)error);
6854
+ }
6802
6855
// -------------------------
6803
6856
} // End of onTuple MTD.
6804
6857
} // End of the HappyPathSink operator.
@@ -8108,10 +8161,11 @@ composite FunctionalTests {
8108
8161
// -------------------------
8109
8162
8110
8163
// B82.1 (INCOMPATIBLE_IN_OPERATION_FOR_LHS_ATTRIB_TYPE 146)
8111
- type Role2_t = rstring role, int32 x, float64 y;
8164
+ type Role2_t = rstring role, int32 x, float32 y;
8112
8165
mutable Role2_t myRole = {};
8113
8166
myRole.role = "Tester";
8114
- _rule = 'x in ["Developer", "Tester", "Admin", "Manager"]';
8167
+
8168
+ _rule = 'y in [1.1, 2.2, 3.3, 4.4, 5.5]';
8115
8169
result = eval_predicate(_rule, myRole, error, $EVAL_PREDICATE_TRACING);
8116
8170
8117
8171
if(result == true) {
@@ -8123,7 +8177,7 @@ composite FunctionalTests {
8123
8177
}
8124
8178
8125
8179
// B82.2 (INCOMPATIBLE_IN_CI_OPERATION_FOR_LHS_ATTRIB_TYPE 147)
8126
- _rule = 'x inCI ["Developer", "Tester", "Admin", "Manager" ]';
8180
+ _rule = 'x inCI [1, 2, 3, 4, 5 ]';
8127
8181
result = eval_predicate(_rule, myRole, error, $EVAL_PREDICATE_TRACING);
8128
8182
8129
8183
if(result == true) {
0 commit comments