Skip to content

Commit

Permalink
Add a check for the number 0 (which is for checking score set to 0) (#…
Browse files Browse the repository at this point in the history
…10004)

This adds a validator plan to check for the number 0 block, which is useful if we want to ensure 0 was passed in as a parameter (used by microsoft/pxt-microbit#5644 to check for setting lives to 0 specifically, which produces output when non-zero values do not)
  • Loading branch information
thsparks authored May 6, 2024
1 parent ffec97e commit 978c9bd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions common-docs/teachertool/validator-plans-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,19 @@
"name": ""
}
]
},
{
".desc": "The zero number block is present.",
"name": "number_zero",
"threshold": 1,
"checks": [
{
"validator": "blockFieldValueExists",
"fieldType": "NUM",
"fieldValue": 0,
"blockType": "math_number"
}
]
}
]
}

0 comments on commit 978c9bd

Please sign in to comment.