testing

package
v0.0.0-...-57974ef Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package testing provides test constants and utilities for the transformer and printer.

Index

Constants

View Source
const (
	// Doctype is the doctype expected for AMP documents.
	Doctype = "<!doctype html>"

	// LinkCanonical is a link to the canonical document.
	LinkCanonical = "<link href=self.html rel=canonical>"

	// LinkFavicon is an example link tag.
	LinkFavicon = "<link href=https://example.com/favicon.ico rel=icon>"

	// LinkGoogleFont is a Google Font stylesheet.
	LinkGoogleFont = "<link href=https://fonts.googleapis.com/css?family=Roboto rel=stylesheet>"

	// LinkGoogleFontEarlyAccess is a Google Font Early Access stylesheet.
	LinkGoogleFontEarlyAccess = "<link href=https://fonts.googleapis.com/earlyaccess/hannari.css>"

	// LinkGoogleFontIcon is a Google Font Icon stylesheet.
	LinkGoogleFontIcon = "<link href=https://fonts.googleapis.com/icon?bolt rel=stylesheet>"

	// LinkGoogleFontDisplayBlock is a Google Font stylesheet with href including display=block component.
	LinkGoogleFontDisplayBlock = "<link href=https://fonts.googleapis.com/css?family=Roboto&amp;display=block rel=stylesheet>"

	// LinkGoogleFontDisplayOptional is a Google Font stylesheet with href including display=optional component.
	LinkGoogleFontDisplayOptional = "<link href=https://fonts.googleapis.com/css?family=Roboto&amp;display=optional rel=stylesheet>"

	// LinkGoogleFontPreconnect is a preconnect for Google Fonts.
	LinkGoogleFontPreconnect = "<link crossorigin=\"\" href=https://fonts.gstatic.com/ rel=\"dns-prefetch preconnect\">"

	// MetaCharset is a required tag for an AMP document.
	MetaCharset = "<meta charset=utf-8>"

	// MetaViewport is a required tag for an AMP document.
	MetaViewport = "<meta content=width=device-width,minimum-scale=1,initial-scale=1 name=viewport>"

	// NoscriptAMPBoilerplate is the standard style for <noscript> tag.
	NoscriptAMPBoilerplate = "" /* 134-byte string literal not displayed */

	// ScriptAMPAccess is the script for amp-access.
	ScriptAMPAccess = "<script async custom-element=amp-access src=https://cdn.ampproject.org/v0/amp-accesss-0.1.js></script>"

	// ScriptAMPAd is the script for amp-ad.
	ScriptAMPAd = "<script async custom-element=amp-ad src=https://cdn.ampproject.org/v0/amp-ad-0.1.js></script>"

	// ScriptAMPAnalytics is the script for amp-analytics.
	ScriptAMPAnalytics = "<script async custom-element=amp-analytics src=https://cdn.ampproject.org/v0/amp-analytics-0.1.js></script>"

	// ScriptAMPAudio is the script for amp-audio.
	ScriptAMPAudio = "<script async custom-element=amp-audio src=https://cdn.ampproject.org/v0/amp-audio-0.1.js></script>"

	// ScriptAMPAudioModule is the module script for amp-audio.
	ScriptAMPAudioModule = "<script async custom-element=amp-audio src=https://cdn.ampproject.org/v0/amp-audio-0.1.mjs type=module></script>"

	// ScriptAMPAudioNomodule is the nomodule script for amp-audio.
	ScriptAMPAudioNomodule = "<script async custom-element=amp-audio nomodule src=https://cdn.ampproject.org/v0/amp-audio-0.1.js></script>"

	// ScriptAMPDynamicCSSClasses is the script for amp-dynamic-css-class.
	ScriptAMPDynamicCSSClasses = "" /* 127-byte string literal not displayed */

	// ScriptAMPExperiment is the script for amp-experiment.
	ScriptAMPExperiment = "<script async custom-element=amp-experiment src=https://cdn.ampproject.org/v0/amp-experiment-0.1.js></script>"

	// ScriptAMPExperimentModule is the module script for amp-experiment.
	ScriptAMPExperimentModule = "<script async custom-element=amp-experiment src=https://cdn.ampproject.org/v0/amp-experiment-0.1.mjs type=module></script>"

	// ScriptAMPExperimentNomodule is the nomodule script for amp-experiment.
	ScriptAMPExperimentNomodule = "<script async custom-element=amp-experiment nomodule src=https://cdn.ampproject.org/v0/amp-experiment-0.1.js></script>"

	// ScriptAMPForm is the script for amp-form.
	ScriptAMPForm = "<script async custom-element=amp-form src=https://cdn.ampproject.org/v0/amp-form-0.1.js></script>"

	// ScriptAMPMraid is the script for amp-mraid.
	ScriptAMPMraid = "<script async host-service=amp-mraid src=https://cdn.ampproject.org/v0/amp-mraid-0.1.js></script>"

	// ScriptAMPMraidModule is the module script for amp-mraid.
	ScriptAMPMraidModule = "<script async host-service=amp-mraid src=https://cdn.ampproject.org/v0/amp-mraid-0.1.mjs type=module></script>"

	// ScriptAMPMraidNomodule is the nomodule script for amp-mraid.
	ScriptAMPMraidNomodule = "<script async host-service=amp-mraid nomodule src=https://cdn.ampproject.org/v0/amp-mraid-0.1.js></script>"

	// ScriptAMPMustache is the script for amp-mustache.
	ScriptAMPMustache = "<script async custom-template=amp-mustache src=https://cdn.ampproject.org/v0/amp-mustache-0.1.js></script>"

	// ScriptAMPMustacheModule is the module script for amp-mustache.
	ScriptAMPMustacheModule = "<script async custom-template=amp-mustache src=https://cdn.ampproject.org/v0/amp-mustache-0.1.mjs type=module></script>"

	// ScriptAMPMustacheNomodule is the nomodule script for amp-mustache.
	ScriptAMPMustacheNomodule = "<script async custom-template=amp-mustache nomodule src=https://cdn.ampproject.org/v0/amp-mustache-0.1.js></script>"

	// ScriptAMPRuntime is the AMP script tag.
	ScriptAMPRuntime = "<script async src=https://cdn.ampproject.org/v0.js></script>"

	// ScriptAMPRuntimeModule is the AMP module script tag.
	ScriptAMPRuntimeModule = "<script async src=https://cdn.ampproject.org/v0.mjs type=module></script>"

	// ScriptAMPRuntimeNomodule is the AMP nomodule script tag.
	ScriptAMPRuntimeNomodule = "<script async nomodule src=https://cdn.ampproject.org/v0.js></script>"

	// ScriptAMPViewerRuntime is the AMP viewer runtime script tag.
	ScriptAMPViewerRuntime = "<script async src=https://cdn.ampproject.org/v0/amp-viewer-integration-0.1.js></script>"

	// ScriptAMP4AdsRuntime is the AMP4Ads script tag.
	ScriptAMP4AdsRuntime = "<script async src=https://cdn.ampproject.org/amp4ads-v0.js></script>"

	// ScriptAMPStory is the script for amp-story.
	ScriptAMPStory = "<script async custom-element=amp-story src=https://cdn.ampproject.org/v0/amp-story-0.1.js></script>"

	// StyleAMP4AdsBoilerplate is the script for amp4ads boilerplate.
	StyleAMP4AdsBoilerplate = "<style amp4ads-boilerplate>body{visibility;hidden}</style>"

	// StyleAMP4EmailBoilerplate is the script for amp4email boilerplate.
	StyleAMP4EmailBoilerplate = "<style amp4email-boilerplate>body{visibility;hidden}</style>"

	// StyleAMPBoilerplate is the standard style.
	StyleAMPBoilerplate = "" /* 629-byte string literal not displayed */

	// StyleAMPCustom is a customized stylesheet for an AMP document.
	StyleAMPCustom = "<style amp-custom>#lemur { color: #adaaad }</style>"

	// StyleAMPRuntime is an injected tag from server-side rendering.
	StyleAMPRuntime = "<style amp-runtime></style>"

	// Title is a title tag for an AMP document.
	Title = "<title>Hello AMP</title>"
)

AMPHTML constants.

Variables

This section is empty.

Functions

func Concat

func Concat(strs ...string) string

Concat concatenates the given strings together.

Types

type TestCase

type TestCase struct {
	Desc               string
	TransformerVersion int64
	Input              string
	Expected           string
}

TestCase stores a description of the test case, the input HTML, and expected output HTML.

Jump to

Keyboard shortcuts

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