Skip to content

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

Open
bubblobill wants to merge 3 commits intoRPTools:developfrom
bubblobill:FunctionUtil-tests
Open

Added tests for most of the methods in FunctionUtil.#5957
bubblobill wants to merge 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
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.

1 participant