Skip to content

Commit

Permalink
Fix in ModelGenerator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshanWeerasinghe committed Nov 3, 2024
1 parent 86b3ab1 commit 0b4fb99
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"offset": 1
}
},
"sourceCode": "public function main() returns error? {\n check fnWithError();\n checkpanic fnWithError();\n\n boolean res1 = check fnWithErrorAndValue();\n boolean res2 = checkpanic fnWithErrorAndValue();\n final var res3 = check fnWithErrorAndValue();\n final var res4 = checkpanic fnWithErrorAndValue();\n}"
"sourceCode": "public function main() returns error? {\n check fnWithError();\n checkpanic fnWithError();\n\n boolean _ = check fnWithErrorAndValue();\n boolean _ = checkpanic fnWithErrorAndValue();\n final var _ = check fnWithErrorAndValue();\n final var _ = checkpanic fnWithErrorAndValue();\n}"
},
"returning": false,
"flags": 0
Expand Down Expand Up @@ -158,7 +158,7 @@
"flags": 2
},
{
"id": "38859",
"id": "38856",
"metadata": {
"label": "fnWithErrorAndValue"
},
Expand All @@ -176,10 +176,10 @@
},
"endLine": {
"line": 7,
"offset": 47
"offset": 44
}
},
"sourceCode": "boolean res1 = check fnWithErrorAndValue();"
"sourceCode": "boolean _ = check fnWithErrorAndValue();"
},
"returning": false,
"properties": {
Expand Down Expand Up @@ -221,7 +221,7 @@
"description": "Name of the variable"
},
"valueType": "IDENTIFIER",
"value": "res1",
"value": "_",
"placeholder": "item",
"optional": false,
"editable": true,
Expand All @@ -240,19 +240,10 @@
"advanced": false
}
},
"diagnostics": {
"hasDiagnostics": true,
"diagnostics": [
{
"severity": "WARNING",
"message": "unused variable 'res1'"
}
]
},
"flags": 1
},
{
"id": "39856",
"id": "39853",
"metadata": {
"label": "fnWithErrorAndValue"
},
Expand All @@ -270,10 +261,10 @@
},
"endLine": {
"line": 8,
"offset": 52
"offset": 49
}
},
"sourceCode": "boolean res2 = checkpanic fnWithErrorAndValue();"
"sourceCode": "boolean _ = checkpanic fnWithErrorAndValue();"
},
"returning": false,
"properties": {
Expand Down Expand Up @@ -315,7 +306,7 @@
"description": "Name of the variable"
},
"valueType": "IDENTIFIER",
"value": "res2",
"value": "_",
"placeholder": "item",
"optional": false,
"editable": true,
Expand All @@ -334,19 +325,10 @@
"advanced": false
}
},
"diagnostics": {
"hasDiagnostics": true,
"diagnostics": [
{
"severity": "WARNING",
"message": "unused variable 'res2'"
}
]
},
"flags": 2
},
{
"id": "40845",
"id": "40842",
"metadata": {
"label": "fnWithErrorAndValue"
},
Expand All @@ -364,10 +346,10 @@
},
"endLine": {
"line": 9,
"offset": 49
"offset": 46
}
},
"sourceCode": "final var res3 = check fnWithErrorAndValue();"
"sourceCode": "final var _ = check fnWithErrorAndValue();"
},
"returning": false,
"properties": {
Expand Down Expand Up @@ -409,7 +391,7 @@
"description": "Name of the variable"
},
"valueType": "IDENTIFIER",
"value": "res3",
"value": "_",
"placeholder": "item",
"optional": false,
"editable": true,
Expand All @@ -428,19 +410,10 @@
"advanced": false
}
},
"diagnostics": {
"hasDiagnostics": true,
"diagnostics": [
{
"severity": "WARNING",
"message": "unused variable 'res3'"
}
]
},
"flags": 5
},
{
"id": "41842",
"id": "41839",
"metadata": {
"label": "fnWithErrorAndValue"
},
Expand All @@ -458,10 +431,10 @@
},
"endLine": {
"line": 10,
"offset": 54
"offset": 51
}
},
"sourceCode": "final var res4 = checkpanic fnWithErrorAndValue();"
"sourceCode": "final var _ = checkpanic fnWithErrorAndValue();"
},
"returning": false,
"properties": {
Expand Down Expand Up @@ -503,7 +476,7 @@
"description": "Name of the variable"
},
"valueType": "IDENTIFIER",
"value": "res4",
"value": "_",
"placeholder": "item",
"optional": false,
"editable": true,
Expand All @@ -522,15 +495,6 @@
"advanced": false
}
},
"diagnostics": {
"hasDiagnostics": true,
"diagnostics": [
{
"severity": "WARNING",
"message": "unused variable 'res4'"
}
]
},
"flags": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ public function main() returns error? {
check fnWithError();
checkpanic fnWithError();

boolean res1 = check fnWithErrorAndValue();
boolean res2 = checkpanic fnWithErrorAndValue();
final var res3 = check fnWithErrorAndValue();
final var res4 = checkpanic fnWithErrorAndValue();
boolean _ = check fnWithErrorAndValue();
boolean _ = checkpanic fnWithErrorAndValue();
final var _ = check fnWithErrorAndValue();
final var _ = checkpanic fnWithErrorAndValue();
}

service /rem on new ftp:Listener({}) {
Expand Down

0 comments on commit 0b4fb99

Please sign in to comment.