testconversions

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2020 License: BSD-3-Clause Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testconversions provides functions to to create arbitrary values of package safehtml types for use by tests only. Note that the created values may violate type contracts.

These functions are useful when types are constructed in a manner where using the package safehtml API is too inconvenient. Please use the package safehtml API whenever possible; there is value in having tests reflect common usage. Using the package safehtml API also avoids, by design, non-contract complying instances from being created.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHTMLForTest

func MakeHTMLForTest(s string) safehtml.HTML

MakeHTMLForTest converts a plain string into a HTML. This function must only be used in tests.

func MakeIdentifierForTest

func MakeIdentifierForTest(s string) safehtml.Identifier

MakeIdentifierForTest converts a plain string into an Identifier. This function must only be used in tests.

func MakeScriptForTest

func MakeScriptForTest(s string) safehtml.Script

MakeScriptForTest converts a plain string into a Script. This function must only be used in tests.

func MakeStyleForTest

func MakeStyleForTest(s string) safehtml.Style

MakeStyleForTest converts a plain string into a Style. This function must only be used in tests.

func MakeStyleSheetForTest

func MakeStyleSheetForTest(s string) safehtml.StyleSheet

MakeStyleSheetForTest converts a plain string into a StyleSheet. This function must only be used in tests.

func MakeTrustedResourceURLForTest

func MakeTrustedResourceURLForTest(s string) safehtml.TrustedResourceURL

MakeTrustedResourceURLForTest converts a plain string into a TrustedResourceURL. This function must only be used in tests.

func MakeURLForTest

func MakeURLForTest(s string) safehtml.URL

MakeURLForTest converts a plain string into a URL. This function must only be used in tests.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL