From c7869fd772ac36e649499a20a1cdfb349fca3f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 23 Mar 2016 20:03:13 +0100 Subject: [PATCH] transform: Clean up the var naming mess in chain_test --- transform/chain_test.go | 120 ++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/transform/chain_test.go b/transform/chain_test.go index 9a133a857..cb8f3d368 100644 --- a/transform/chain_test.go +++ b/transform/chain_test.go @@ -22,93 +22,93 @@ import ( "testing" ) -const H5_JS_CONTENT_DOUBLE_QUOTE = "
content foobar. Follow up
" -const H5_JS_CONTENT_SINGLE_QUOTE = "
content foobar. Follow up
" -const H5_JS_CONTENT_ABS_URL = "
content foobar. Follow up
" -const H5_JS_CONTENT_ABS_URL_SCHEMALESS = "
content foobar. Follow up
" -const CORRECT_OUTPUT_SRC_HREF_SQ = "
content foobar. Follow up
" +const h5JsContentDoubleQuote = "
content foobar. Follow up
" +const h5JsContentSingleQuote = "
content foobar. Follow up
" +const h5JsContentAbsURL = "
content foobar. Follow up
" +const h5JsContentAbsURLSchemaless = "
content foobar. Follow up
" +const corectOutputSrcHrefSq = "
content foobar. Follow up
" -const H5_XML_CONTENT_ABS_URL = "<p><a href="/foobar">foobar</a></p> <p>A video: <iframe src='/foo'></iframe></p>" -const CORRECT_OUTPUT_SRC_HREF_IN_XML = "<p><a href="http://base/foobar">foobar</a></p> <p>A video: <iframe src='http://base/foo'></iframe></p>" -const H5_XML_CONTENT_GUARDED = "<p><a href="//foobar">foobar</a></p> <p>A video: <iframe src='//foo'></iframe></p>" +const h5XMLXontentAbsURL = "<p><a href="/foobar">foobar</a></p> <p>A video: <iframe src='/foo'></iframe></p>" +const correctOutputSrcHrefInXML = "<p><a href="http://base/foobar">foobar</a></p> <p>A video: <iframe src='http://base/foo'></iframe></p>" +const h5XMLContentGuarded = "<p><a href="//foobar">foobar</a></p> <p>A video: <iframe src='//foo'></iframe></p>" // additional sanity tests for replacements testing -const REPLACE_1 = "No replacements." -const REPLACE_2 = "ᚠᛇᚻ ᛒᛦᚦ ᚠᚱᚩᚠᚢᚱ\nᚠᛁᚱᚪ ᚷᛖᚻᚹᛦᛚᚳᚢᛗ" -const REPLACE_3 = `End of file: src="/` -const REPLACE_4 = `End of file: srcset="/` -const REPLACE_5 = `Srcsett with no closing quote: srcset="/img/small.jpg do be do be do.` +const replace1 = "No replacements." +const replace2 = "ᚠᛇᚻ ᛒᛦᚦ ᚠᚱᚩᚠᚢᚱ\nᚠᛁᚱᚪ ᚷᛖᚻᚹᛦᛚᚳᚢᛗ" +const replace3 = `End of file: src="/` +const replace4 = `End of file: srcset="/` +const replace5 = `Srcsett with no closing quote: srcset="/img/small.jpg do be do be do.` // Issue: 816, schemaless links combined with others -const REPLACE_SCHEMALESS_HTML = `Pre. src='//schemaless' src='/normal' Schemaless. normal. Post.` -const REPLACE_SCHEMALESS_HTML_CORRECT = `Pre. src='//schemaless' src='http://base/normal' Schemaless. normal. Post.` -const REPLACE_SCHEMALESS_XML = `Pre. src='//schemaless' src='/normal' Schemaless. normal. Post.` -const REPLACE_SCHEMALESS_XML_CORRECT = `Pre. src='//schemaless' src='http://base/normal' Schemaless. normal. Post.` +const replaceSchemalessHTML = `Pre. src='//schemaless' src='/normal' Schemaless. normal. Post.` +const replaceSchemalessHTMLCorrect = `Pre. src='//schemaless' src='http://base/normal' Schemaless. normal. Post.` +const replaceSchemalessXML = `Pre. src='//schemaless' src='/normal' Schemaless. normal. Post.` +const replaceSchemalessXMLCorrect = `Pre. src='//schemaless' src='http://base/normal' Schemaless. normal. Post.` // srcset= -const SRCSET_BASIC = `Pre. text` -const SRCSET_BASIC_CORRECT = `Pre. text` -const SRCSET_SINGLE_QUOTE = `Pre. text POST.` -const SRCSET_SINGLE_QUOTE_CORRECT = `Pre. text POST.` -const SRCSET_XML_BASIC = `Pre. "text"` -const SRCSET_XML_BASIC_CORRECT = `Pre. "text"` -const SRCSET_XML_SINGLE_QUOTE = `Pre. "text"` -const SRCSET_XML_SINGLE_QUOTE_CORRECT = `Pre. "text"` -const SRCSET_VARIATIONS = `Pre. +const srcsetBasic = `Pre. text` +const srcsetBasicCorrect = `Pre. text` +const srcsetSingleQuote = `Pre. text POST.` +const srcsetSingleQuoteCorrect = `Pre. text POST.` +const srcsetXMLBasic = `Pre. "text"` +const srcsetXMLBasicCorrect = `Pre. "text"` +const srcsetXMLSingleQuote = `Pre. "text"` +const srcsetXMLSingleQuoteCorrect = `Pre. "text"` +const srcsetVariations = `Pre. Missing start quote: text src='/img/foo.jpg'> FOO. schemaless: schemaless2: text src='http://base/img/foo.jpg'> FOO. schemaless: schemaless2: