TestSpec_PublicAPI_SanitizeParameterName validates the documented behavior of SanitizeParameterName as described in the package README.md. Specification: "Sanitizes a parameter name for use as a GitHub Actions output or environment variable name. Preserves letters, digits, $, and _, and replaces al
(t *testing.T)
| 488 | // or environment variable name. Preserves letters, digits, $, and _, and replaces |
| 489 | // all other characters with underscores." |
| 490 | func TestSpec_PublicAPI_SanitizeParameterName(t *testing.T) { |
| 491 | t.Run("preserves letters digits underscores and $", func(t *testing.T) { |
| 492 | result := SanitizeParameterName("Hello_World$1") |
| 493 | assert.Equal(t, "Hello_World$1", result, |
| 494 | "letters, digits, _, and $ should be preserved") |
| 495 | }) |
| 496 | |
| 497 | t.Run("replaces other characters with underscores", func(t *testing.T) { |
| 498 | result := SanitizeParameterName("foo-bar.baz") |
| 499 | assert.Equal(t, "foo_bar_baz", result, |
| 500 | "non-preserved characters should be replaced with underscores") |
| 501 | }) |
| 502 | } |
| 503 | |
| 504 | // TestSpec_PublicAPI_SanitizePythonVariableName validates the documented behavior |
| 505 | // of SanitizePythonVariableName as described in the package README.md. |
nothing calls this directly
no test coverage detected