Skip to content

Added tests for most of the methods in FunctionUtil.#5957

Merged
cwisniew merged 3 commits intoRPTools:developfrom
bubblobill:FunctionUtil-tests
Apr 16, 2026
Merged

Added tests for most of the methods in FunctionUtil.#5957
cwisniew merged 3 commits intoRPTools:developfrom
bubblobill:FunctionUtil-tests

Conversation

@bubblobill
Copy link
Copy Markdown
Collaborator

@bubblobill bubblobill commented Apr 7, 2026

Identify the Bug or Feature request

fixes #5956
closes #5956

Description of the Change

Missing tests for: i.e. I couldn't work out how to get them to fly.

  • FunctionUtil.experimentalWarning()
  • FunctionUtil.getTokenFromParam()
  • FunctionUtil.getZoneRendererFromParam()
  • FunctionUtil.getZoneRenderer()
  • FunctionUtil.getAssetKeyFromString()
  • FunctionUtil.blockUntrustedMacro()

Added tests for;

  • checkNumberParam()

  • delimitedResult()

  • getBooleanValue()

  • getPaintFromString()

  • paramAsBoolean()

  • paramAsString()

  • paramAsInteger()

  • paramAsDouble()

  • paramAsFloat()

  • paramAsBigDecimal()

  • paramFromStrPropOrJsonAsJsonObject()

  • paramAsJson()

  • paramAsJsonObject()

  • paramAsJsonArray()

  • paramConvertedToJsonArray()

  • paramConvertedToJson()

  • jsonWithLowerCaseKeys()

  • validateKeyNames()

Possible Drawbacks

Macros relying on dodgy flavours might fail the taste test, though unlikely.

Release Notes

Improved macro argument processing


This change is Reviewable

@github-actions github-actions bot added the code-maintenance Adding/editing javadocs, unit tests, formatting. label Apr 7, 2026
@bubblobill
Copy link
Copy Markdown
Collaborator Author

Tests failing before fixes:

  • FunctionUtilTest > paramFromStrPropOrJsonAsJsonObject() FAILED
  • FunctionUtilTest > FunctionUtil.paramAsBoolean() FAILED
  • FunctionUtilTest > FunctionUtil.paramAsDouble() FAILED
  • FunctionUtilTest > FunctionUtil.paramAsBigDecimal() FAILED
  • FunctionUtilTest > FunctionUtil.getBooleanValue() FAILED
  • FunctionUtilTest > FunctionUtil.paramAsFloat() FAILED
  • FunctionUtilTest > FunctionUtil.paramAsInteger() FAILED

@bubblobill bubblobill self-assigned this Apr 7, 2026
@cwisniew cwisniew added this pull request to the merge queue Apr 16, 2026
Merged via the queue into RPTools:develop with commit 4772f55 Apr 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-maintenance Adding/editing javadocs, unit tests, formatting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Maintenance]: FunctionUtil has no tests - which they would fail if they existed.

2 participants