testing

package
v0.0.0-...-a20b76d Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 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>"

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

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

	// 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>"

	// 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>"

	// 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>"

	// 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>"

	// ScriptAMPRuntime is the AMP script tag.
	ScriptAMPRuntime = "<script async 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