Skip to main content

Module escape

Module escape 

Source
Expand description

Language-specific string escaping for e2e test code generation.

Functions§

escape_c
Escape a string for embedding in a C string literal.
escape_csharp
Escape a string for embedding in a C# string literal.
escape_elixir
Escape a string for embedding in an Elixir string literal.
escape_gleam
Escape a string for embedding in a Gleam string literal.
escape_go
Escape a string for embedding in a Go double-quoted string.
escape_java
Escape a string for embedding in a Java string literal.
escape_js
Escape a string for embedding in a JavaScript/TypeScript double-quoted string literal.
escape_js_template
Escape a string for embedding in a JavaScript/TypeScript template literal (backtick string).
escape_php
Escape a string for embedding in a PHP string literal.
escape_python
Escape a string for embedding in a Python string literal.
escape_r
Escape a string for embedding in an R string literal.
escape_ruby
Escape a string for embedding in a double-quoted Ruby string literal.
escape_ruby_single
Escape a string for embedding in a single-quoted Ruby string literal. Single-quoted Ruby strings only interpret \\ and \'.
escape_rust
Escape a string for embedding in a Rust string literal.
escape_shell
Escape a string for embedding in a POSIX single-quoted shell string literal.
escape_zig
Escape a string for embedding in a Zig string literal.
expand_fixture_templates
Expand fixture template expressions in a string value.
go_string_literal
Format a string as a Go string literal (backtick or quoted).
raw_string_hashes
Compute the number of # needed for a Rust raw string literal.
ruby_needs_double_quotes
Returns true if the string needs double quotes (contains control characters that require escape sequences only available in double-quoted strings).
ruby_string_literal
Format a string as a Ruby literal, preferring single quotes.
rust_raw_string
Format a string as a Rust raw string literal (r#“…”#).
sanitize_filename
Convert a category name to a sanitized filename component.
sanitize_ident
Sanitize an identifier for use as a test function name. Replaces non-alphanumeric characters with underscores, strips leading digits.