Modulo:ScribuntoUnit e Richard Marx: differenze tra le pagine

(Differenze fra le pagine)
Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
corrispondenti template su it.wiki
 
Recupero di 3 fonte/i e segnalazione di 0 link interrotto/i. #IABot (v2.0beta15)
 
Riga 1:
{{Artista musicale
-------------------------------------------------------------------------------
|nome = Richard Marx
-- Unit tests for Scribunto.
|nazione = USA
-------------------------------------------------------------------------------
|genere = Pop rock
local DebugHelper = {}
|genere2 = Adult Contemporary
local ScribuntoUnit = {}
|anno inizio attività = 1982
|anno fine attività = in attività
|note periodo attività =
|tipo artista = cantautore
|immagine = Richardmarx-jan27th2005-0002.jpg
|didascalia = Richard Marx nel 2005
|url = http://www.richardmarx.com
|numero totale album pubblicati = 21
|numero album studio = 9
|numero album live = 4
|numero raccolte = 8
}}
{{Bio
|Nome = Richard Noel
|Cognome = Marx
|Sesso = M
|LuogoNascita = Chicago
|GiornoMeseNascita = 16 settembre
|AnnoNascita = 1963
|LuogoMorte =
|GiornoMeseMorte =
|AnnoMorte =
|Attività = cantautore
|Attività2 = compositore
|Attività3 = produttore discografico
|Nazionalità = statunitense
}}
 
Ottiene una serie di enormi successi a cavallo fra gli anni '80 e i '90 con brani come ''[[Endless Summer Nights]]'', ''[[Hold On to the Nights]]'', ''[[Right Here Waiting]]'', ''[[Hazard (singolo)|Hazard]]'' e ''[[Now and Forever (Richard Marx)|Now and Forever]]''. Benché la maggior parte dei suoi brani più popolari siano delle [[Ballata (musica)|ballate]], il suo repertorio è in gran parte in stile [[rock]], come è dimostrato dai singoli ''[[Don't Mean Nothing]]'', ''[[Should've Known Better]]'', ''[[Satisfied]]'' ''[[Take This Heart]]'' e ''[[Angelia]]''. È stato il primo cantante a piazzare i primi sette singoli della sua carriera nella top 5 della [[Billboard Hot 100]]<ref name="yamaha.com">{{Cita web | url=http://www.yamaha.com/namm/w2007/PressReleaseDetail.html?CTID=5041570&SUB_CAT_ID=5041570&CNTID=545082&DDL_CAT=0 | editore=Yamaha | titolo=Yamaha Announces Incredible Lineup for 2007 Dealer Concert | accesso=9 aprile 2007}}</ref>. Ha venduto più di 30 milioni di copie nel mondo.<ref name="yamaha.com"/>
-------------------------------------------------------------------------------
-- Concatenates keys and values, ideal for displaying a template argument table.
-- @param keySeparator glue between key and value (defaults to " = ")
-- @param separator glue between different key-value pairs (defaults to ", ")
-- @example concatWithKeys({a = 1, b = 2, c = 3}, ' => ', ', ') => "a => 1, b => 2, c => 3"
--
function DebugHelper.concatWithKeys(table, keySeparator, separator)
keySeparator = keySeparator or ' = '
separator = separator or ', '
local concatted = ''
local i = 1
local first = true
local unnamedArguments = true
for k, v in pairs(table) do
if first then
first = false
else
concatted = concatted .. separator
end
if k == i and unnamedArguments then
i = i + 1
concatted = concatted .. tostring(v)
else
unnamedArguments = false
concatted = concatted .. tostring(k) .. keySeparator .. tostring(v)
end
end
return concatted
end
 
Marx è anche celebre per aver scritto brani per importanti artisti come [[Julio Iglesias]], [[Michael Bolton]], [[Keith Urban]], [[LeAnn Rimes]], [[Barry Manilow]], [[Barbra Streisand]], [[Kenny Loggins]], [[Vixen]], [[Luther Vandross]], [['N Sync]], [[Olivia Newton-John]], [[Sarah Brightman]] e [[Laura Pausini]]. Con il brano ''[[Dance With My Father]]'' eseguito da [[Luther Vandross]] vinse il [[Grammy Awards]].<ref>{{Cita web|url=http://mixonline.com/mag/audio_richard_marx/|titolo=Richard Marx|data=1º settembre 2004|autore=Gary Eskow|editore=Mixonline|urlmorto=sì|urlarchivio=https://web.archive.org/web/20110629141045/http://mixonline.com/mag/audio_richard_marx/|dataarchivio=29 giugno 2011}}</ref>
-------------------------------------------------------------------------------
-- Compares two tables recursively (non-table values are handled correctly as well).
-- @param ignoreMetatable if false, t1.__eq is used for the comparison
--
function DebugHelper.deepCompare(t1, t2, ignoreMetatable)
local type1 = type(t1)
local type2 = type(t2)
 
Marx è stato sposato dal [[1989]] al [[2014]] con la ballerina, attrice e cantante [[Cynthia Rhodes]], da cui ha avuto tre figli: Brandon, Lucas e Jesse. La coppia ha divorziato dopo 25 anni di matrimonio.
if type1 ~= type2 then
return false
end
if type1 ~= 'table' then
return t1 == t2
end
 
Le principali influenze musicali di Marx sono [[Sam Cooke]] e [[Elvis Presley]], oltre a [[Donny Hathaway]], [[Steven Tyler]], [[Elton John]], [[Kenny Loggins]], [[Peter Gabriel]], [[Daniel Lanois]], [[Annie Lennox]], gli [[U2]], [[Dave Grusin]], [[John Farnham]], [[Billy Joel]], [[Rod Stewart]], gli [[Eagles]], [[Luther Vandross]], [[Earth, Wind & Fire]] e [[Gladys Knight]].<ref name="Influences">{{Cita web | url=https://myspace.com/officialrichardmarx | editore= Myspace/Richard Marx| titolo=Influences | accesso=25 novembre 2008}}</ref>
local metatable = getmetatable(t1)
if not ignoreMetatable and metatable and metatable.__eq then
return t1 == t2
end
 
== Biografia ==
for k1, v1 in pairs(t1) do
=== L'infanzia e gli esordi, 1963-1986 ===
local v2 = t2[k1]
Marx fu l'unico figlio della coppia Ruth, ex cantante, e Dick Marx, musicista [[jazz]] e fondatore di una compagnia musicale di successo negli [[anni 1960|anni sessanta]]. Richard crebbe con tre fratellastri, nati da un precedente matrimonio del padre.<ref>{{Cita news | url=https://www.nytimes.com/1997/08/14/classified/paid-notice-deaths-marx-richard-h-dick.html|titolo=Dick Marx's Death Notice| accesso=5 aprile 2009 | pubblicazione=The New York Times | data=14 agosto 1997}}</ref>
if v2 == nil or not DebugHelper.deepCompare(v1, v2) then
return false
end
end
for k2, v2 in pairs(t2) do
if t1[k2] == nil then
return false
end
end
 
La carriera di Richard Marx iniziò all'età di cinque anni quando cantò per alcuni brani pubblicitari scritti dal padre. Tra i più famosi vi furono ''Arm & Hammer'' e ''Nestlé Crunch''.
return true
end
 
Richard era diciassettenne quando una registrazione di un suo pezzo finì nelle mani di [[Lionel Richie]], il quale notò il talento del giovane e lo contattò dicendo:<ref>{{Cita web | url=http://www.richardmarxonline.com/web/bio_early.htm | editore=richardmarxonline.com | titolo=Biography and Career Highlights: The Early Years | accesso=14 maggio 2007 | urlmorto=sì | urlarchivio=https://web.archive.org/web/20070107232755/http://www.richardmarxonline.com/web/bio_early.htm | dataarchivio=7 gennaio 2007 }}</ref>
-------------------------------------------------------------------------------
-- Raises an error with stack information
-- @param details a table with error details
-- - should have a 'text' key which is the error message to display
-- - a 'trace' key will be added with the stack data
-- - and a 'source' key with file/line number
-- - a metatable will be added for error handling
--
function DebugHelper.raise(details, level)
level = (level or 1) + 1
details.trace = debug.traceback('', level)
details.source = mw.text.split(details.trace, '%s')[5]
-- this would be more robust but does not work
-- local match = string.match(details.trace, '^%s*stack traceback:%s*(%S*): ')
-- details.source = match and match[1] or ''
 
{{citazione|Non ti posso promettere nulla, ma dovresti venire a Los Angeles||I can't promise you anything, but you should come to L.A.|lingua=en}}
-- setmetatable(details, {
-- __tostring: function() return details.text end
-- })
error(details, level)
end
 
Così, dopo essersi diplomato, Marx si trasferì a [[Los Angeles]] per visitare Richie e lì registrò le parti da [[corista]] per il suo disco ''[[Lionel Richie (album)|Lionel Richie]]'' nel brano ''You Are''. Successivamente canterà in ''Running with the Night'' e ''All Night Long'', nel seguente disco di Richie ''[[Can't Slow Down (Lionel Richie)|Can't Slow Down]]''.
-------------------------------------------------------------------------------
-- when used in a test, that test gets ignored, and the skipped count increases by one.
--
function ScribuntoUnit:markTestSkipped()
DebugHelper.raise({ScribuntoUnit = true, skipped = true}, 3)
end
 
In questi stessi anni, Richard riuscì a farsi assumere in uno studio di registrazione e il suo entusiasmo e la sua presenza lo portarono a registrare parti vocali per [[Madonna (cantante)|Madonna]], [[Whitney Houston]] e [[Luther Vandross]]. Marx ebbe anche una piccola parte nel film ''Coach Of The Year'' con [[Robert Conrad]]. Nel 1984 iniziò una collaborazione con [[Kenny Rogers]], per il quale compose i brani ''Crazy'', numero 1 nella [[Hot Adult Contemporary Tracks]] e numero 5 nella [[Billboard Hot 100]], e ''What About Me?''', numero 1 e numero 15. Poco dopo iniziò a lavorare con il produttore [[David Foster]] e scrisse canzoni per i [[Chicago (gruppo musicale)|Chicago]] e per [[Freddie Jackson]].
-------------------------------------------------------------------------------
-- Checks that the input is true
-- @param message optional description of the test
--
function ScribuntoUnit:assertTrue(actual, message)
if not actual then
DebugHelper.raise({ScribuntoUnit = true, text = string.format("Failed to assert that %s is true", tostring(actual)), message = message}, 2)
end
end
 
Mentre la sua carriera da compositore e produttore proseguiva, Marx continuò a seguire il sogno di diventare egli stesso un artista. Finalmente quattro anni dopo essersi trasferito a [[Los Angeles]], [[Bruce Lundvall]], presidente della [[EMI]], ascoltò una sua demo e lo pose sotto contratto. Marx contattò così il suo amico [[Fee Waybill]] dei [[The Tubes]] e altri talentuosi musicisti come [[Joe Walsh]] e [[Randy Meisner]] degli [[Eagles]], per iniziare a registrare il suo primo album.
-------------------------------------------------------------------------------
-- Checks that the input is false
-- @param message optional description of the test
--
function ScribuntoUnit:assertFalse(actual, message)
if actual then
DebugHelper.raise({ScribuntoUnit = true, text = string.format("Failed to assert that %s is false", tostring(actual)), message = message}, 2)
end
end
 
=== I primi due album, 1987-1990 ===
-------------------------------------------------------------------------------
Il primo album di Richard Marx, l'omonimo ''[[Richard Marx (album)|Richard Marx]]'', fu pubblicato nel giugno 1987, e ottenne quattro singoli e quasi 4 milioni di copie vendute negli [[USA]]. Il singolo di debutto ''[[Don't Mean Nothing]]'' fu numero 3 nella [[Billboard Hot 100]] e numero 1 nella [[Mainstream Rock Songs]]. Marx fu il primo artista ad essere suonato in 117 stazioni radio del mondo durante la prima settimana dopo l'uscita del disco. ''[[Should've Known Better]]'' e ''[[Endless Summer Nights]]'' si piazzarono rispettivamente alla numero 3 e alla numero 2, ''[[Hold On to the Nights]]'' fu il primo numero 1 della carriera di Richard Marx.
-- Checks an input string contains the expected string
-- @param message optional description of the test
-- @param plain search is made with a plain string instead of a ustring pattern
--
function ScribuntoUnit:assertStringContains(pattern, s, plain, message)
if type(pattern) ~= 'string' then
DebugHelper.raise({
ScribuntoUnit = true,
text = mw.ustring.format("Pattern type error (expected string, got %s)", type(pattern)),
message = message
}, 2)
end
if type(s) ~= 'string' then
DebugHelper.raise({
ScribuntoUnit = true,
text = mw.ustring.format("String type error (expected string, got %s)", type(s)),
message = message
}, 2)
end
if not mw.ustring.find(s, pattern, nil, plain) then
DebugHelper.raise({
ScribuntoUnit = true,
text = mw.ustring.format('Failed to find %s "%s" in string "%s"', plain and "plain string" or "pattern", pattern, s),
message = message
}, 2)
end
end
 
Grazie a questo debutto, Marx fu il primo cantante uomo a raggiungere la top 3 con quattro singoli del suo primo album. Partì così per il suo primo tour mondiale, prima al fianco dei [[REO Speedwagon]], successivamente solista. Rimase ''on the road'' per quattordici mesi e l'album fu nelle classifiche per più di un anno e mezzo.
-------------------------------------------------------------------------------
-- Checks an input string doesn't contain the expected string
-- @param message optional description of the test
-- @param plain search is made with a plain string instead of a ustring pattern
--
function ScribuntoUnit:assertNotStringContains(pattern, s, plain, message)
if type(pattern) ~= 'string' then
DebugHelper.raise({
ScribuntoUnit = true,
text = mw.ustring.format("Pattern type error (expected string, got %s)", type(pattern)),
message = message
}, 2)
end
if type(s) ~= 'string' then
DebugHelper.raise({
ScribuntoUnit = true,
text = mw.ustring.format("String type error (expected string, got %s)", type(s)),
message = message
}, 2)
end
local i, j = mw.ustring.find(s, pattern, nil, plain)
if i then
local match = mw.ustring.sub(s, i, j)
DebugHelper.raise({
ScribuntoUnit = true,
text = mw.ustring.format('Found match "%s" for %s "%s"', match, plain and "plain string" or "pattern", pattern),
message = message
}, 2)
end
end
 
Nel [[1988]] Marx fu nominato per un [[Grammy Award]] come ''[[Grammy Award alla miglior interpretazione vocale rock solista|Miglior interpretazione rock vocale solista]]'' con ''Don't Mean Nothing''.<ref>{{Cita web | url=http://www.richardmarxonline.com/web/bio_debut.htm | editore=richardmarxonline.com | titolo=Biography and Career Highlights | accesso=15 aprile 2007 | urlmorto=sì | urlarchivio=https://web.archive.org/web/20070107232527/http://www.richardmarxonline.com/web/bio_debut.htm | dataarchivio=7 gennaio 2007 }}</ref>
-------------------------------------------------------------------------------
-- Checks that an input has the expected value.
-- @param message optional description of the test
-- @example assertEquals(4, add(2,2), "2+2 should be 4")
--
function ScribuntoUnit:assertEquals(expected, actual, message)
 
Il secondo album ''[[Repeat Offender]]'' uscì nel maggio 1989 e raggiunse la prima posizione nelle classifiche detronizzando [[Prince]] dalla numero 1 nella Billboard 200. Divenne triplo [[disco di platino]] dopo pochi mesi e vendette 5 milioni di copie in [[America]]. ''Repeat Offender'' era stato composto interamente da Marx durante i 14 mesi di vita ''on the road''.
if type(expected) == 'number' and type(actual) == 'number' then
self:assertWithinDelta(expected, actual, 1e-8, message)
 
{{citazione|Alcune persone possono pensare che sia facile essere sempre lontano da casa, che io debba solo divertirmi, ma la verità è che è difficile, e avrò ancora da provarvelo|Richard Marx|Some people might think that it would be easier this time around, that I could just kick back," Marx said at the time, "but the truth is, it’s harder, I’ve got more to prove.|lingua=en}}
elseif expected ~= actual then
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Failed to assert that %s equals expected %s", tostring(actual), tostring(expected)),
actual = actual,
expected = expected,
message = message,
}, 2)
end
 
I primi due singoli, ''[[Satisfied]]'' e ''[[Right Here Waiting]]'', raggiunsero entrambi la numero 1, completando la serie di tre piazzamenti consecutivi al numero 1. Grazie a ''[[Angelia]]'', che raggiunse invece la numero 4, Marx divenne il primo artista solista a raggiungere la top 5 con i suoi primi sette singoli. ''[[Children of the Night (Richard Marx)|Children of the Night]]'' fu scritta in supporto a un'organizzazione dell'underground di Los Angeles che aiutava i ragazzini orfani e tutti gli incassi di questo brano furono donati all'associazione stessa.
end
 
Il secondo tour mondiale di Richard Marx iniziò nell'autunno del 1989 e toccò l'[[Australia]], [[Singapore]], la [[Malaysia]], il [[Giappone]], l'[[Europa]], il [[Canada]] e gli [[Stati Uniti]], terminando nell'agosto [[1990]] con celebri show al [[Royal Albert Hall]] di [[Londra]] e un invito di [[Tina Turner]] per degli concerti in [[Germania]].
-------------------------------------------------------------------------------
-- Checks that 'actual' is within 'delta' of 'expected'.
-- @param message optional description of the test
-- @example assertEquals(1/3, 9/3, "9/3 should be 1/3", 0.000001)
function ScribuntoUnit:assertWithinDelta(expected, actual, delta, message)
if type(expected) ~= "number" then
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Expected value %s is not a number", tostring(expected)),
actual = actual,
expected = expected,
message = message,
}, 2)
end
if type(actual) ~= "number" then
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Actual value %s is not a number", tostring(actual)),
actual = actual,
expected = expected,
message = message,
}, 2)
end
local diff = expected - actual
if diff < 0 then diff = - diff end -- instead of importing math.abs
if diff > delta then
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Failed to assert that %f is within %f of expected %f", actual, delta, expected),
actual = actual,
expected = expected,
message = message,
}, 2)
end
end
 
Marx ricevette anche la sua seconda nomina ai Grammy nel 1990, stavolta come ''[[Grammy Award alla miglior interpretazione vocale maschile|Miglior interpretazione vocale maschile]]'' in ''Right Here Waiting.<ref>{{Cita web | url=http://www.rockonthenet.com/archive/1990/grammys.htm | editore=Rock On The Net | titolo=32nd Grammy Awards - 1990 presented February 22, 1990 | accesso=15 aprile 2007}}</ref>
-------------------------------------------------------------------------------
-- Checks that a table has the expected value (including sub-tables).
-- @param message optional description of the test
-- @example assertDeepEquals({{1,3}, {2,4}}, partition(odd, {1,2,3,4}))
function ScribuntoUnit:assertDeepEquals(expected, actual, message)
if not DebugHelper.deepCompare(expected, actual) then
if type(expected) == 'table' then
expected = mw.dumpObject(expected)
end
if type(actual) == 'table' then
actual = mw.dumpObject(actual)
end
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Failed to assert that %s equals expected %s", tostring(actual), tostring(expected)),
actual = actual,
expected = expected,
message = message,
}, 2)
end
end
 
=== Rush Street, Paid Vacation e Flesh and Bone, 1991-1999 ===
-------------------------------------------------------------------------------
Nel 1991 Richard Marx pubblicò il suo terzo consecutivo disco multi-platino ''[[Rush Street]]''. L'album vide la partecipazione di artisti come [[Luther Vandross]] e [[Billy Joel]] nel ruolo di coristi e pianisti. Il primo singolo estratto ''[[Keep Coming Back]]'' fu numero 12 nelle classifiche pop e numero 1 nella [[Adult contemporary music|Adult Contemporary Chart]] per 4 settimane. ''[[Hazard (singolo)|Hazard]]'', che dipingeva la storia di un uomo accusato erroneamente di omicidio nella cittadina di [[Hazard (Nebraska)|Hazard]], nel [[Nebraska]], divenne numero 1 nelle classifiche mondiali. Altri due singoli da top 10 furono ''[[Take This Heart]]'' (AC numero 4, Hot 100 numero 20) e ''[[Chains Around My Heart]]'' (AC numero 9, Hot 100 numero 44). Nell'agosto 2001 Marx ammise che la traccia ''Superstar'' era dedicata alla popstar [[Madonna (cantante)|Madonna]].<ref>[http://www.richardmarxonline.com/web/askrichard_aug01.htm Richard Marx Online!<!-- Bot generated title -->] {{webarchive|url=https://web.archive.org/web/20070107232620/http://www.richardmarxonline.com/web/askrichard_aug01.htm |data=7 gennaio 2007 }}</ref>
-- Checks that a wikitext gives the expected result after processing.
-- @param message optional description of the test
-- @example assertResultEquals("Hello world", "{{concat|Hello|world}}")
function ScribuntoUnit:assertResultEquals(expected, text, message)
local frame = self.frame
local actual = frame:preprocess(text)
if expected ~= actual then
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Failed to assert that %s equals expected %s after preprocessing", text, tostring(expected)),
actual = actual,
actualRaw = text,
expected = expected,
message = message,
}, 2)
end
end
 
Nel 1994, dopo il trasferimento con la famiglia da Los Angeles a [[Chicago]], Marx pubblicò ''[[Paid Vacation]]'', raggiungendo per la quarta volta consecutiva il [[disco di platino]]. La [[power ballad]] acustica ''[[Now and Forever (Richard Marx)|Now and Forever]]'', scritta per la colonna sonora del film ''[[Getaway (film 1994)|Gateway]]'', fu numero 7 nella Hot 100 e rimase per quattro settimane nella top 10 (e numero 12 nel [[Regno Unito]]). Mantenne anche la numero 1 nella Adult Contemporary Chart per undici settimane, una sola settimana sotto il record assoluto di permanenza. Il seguente singolo, ''The Way She Loves Me'', divenne numero 3 nella classifica AC e numero 20 nelle classifiche Pop.
-------------------------------------------------------------------------------
-- Checks that two wikitexts give the same result after processing.
-- @param message optional description of the test
-- @example assertSameResult("{{concat|Hello|world}}", "{{deleteLastChar|Hello world!}}")
function ScribuntoUnit:assertSameResult(text1, text2, message)
local frame = self.frame
local processed1 = frame:preprocess(text1)
local processed2 = frame:preprocess(text2)
if processed1 ~= processed2 then
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Failed to assert that %s equals expected %s after preprocessing", processed1, processed2),
actual = processed1,
actualRaw = text1,
expected = processed2,
expectedRaw = text2,
message = message,
}, 2)
end
end
 
Nel 1997 fu dato alle stampe ''[[Flesh and Bone (Richard Marx)|Flesh and Bone]]'', ultimo album in studio pubblicato sotto la [[Capitol Records]]. Il disco vendette 250&nbsp;000 copie nei soli USA. ''Until I Find You Again'' fu numero 1 in molti Paesi e numero 3 negli [[Stati Uniti]]. Nel novembre '97 fu pubblicata anche la prima raccolta di Marx, ''[[Greatest Hits (Richard Marx)|Greatest Hits]]'', contenente 16 tracce più un inedito, ''Angel's Lullaby'', brano scritto per i suoi figli e che era apparso per la prima volta in ''For Our Children, Too'', una raccolta pubblicata nel 1996 per la ''Pediatric AIDS Foundation''. Nel 1998 ''Greatest Hits'' uscì anche in [[Asia]] con due inediti a titolo ''Slipping Away'' e ''Thanks To You'', toccante tributo alla madre.
-------------------------------------------------------------------------------
-- Checks that a template gives the expected output.
-- @param message optional description of the test
-- @example assertTemplateEquals("Hello world", "concat", {"Hello", "world"})
function ScribuntoUnit:assertTemplateEquals(expected, template, args, message)
local frame = self.frame
local actual = frame:expandTemplate(template, args)
if expected ~= actual then
DebugHelper.raise({
ScribuntoUnit = true,
text = string.format("Failed to assert that %s with args %s equals expected %s after preprocessing",
DebugHelper.concatWithKeys(args), template, expected),
actual = actual,
actualRaw = template,
expected = expected,
message = message,
}, 2)
end
end
 
Nel 1997 duetta con [[Donna Lewis]] in ''[[At the Beginning]]'', colonna sonora del film d'animazione ''[[Anastasia (film 1997)|Anastasia]]''.
-------------------------------------------------------------------------------
-- Creates a new test suite.
-- @param o a table with test functions (alternatively, the functions can be added later to the returned suite)
--
function ScribuntoUnit:new(o)
o = o or {}
setmetatable(o, {__index = self})
o.run = function(frame) return self:run(o, frame) end
return o
end
 
=== I seguenti dischi e il periodo recente, 2000-oggi ===
-------------------------------------------------------------------------------
Nel 2000 Marx pubblicò il suo sesto album ''[[Days in Avalon]]'' con la casa discografica [[Signal 21 Records]], fondata da Marx stesso e l'ex-batterista dei [[Blood, Sweat & Tears]] e produttore [[Bobby Colomby]]. Il brano omonimo ''Days in Avalon'' entrò nella Adult Contemporary Chart e rimase per dodici settimane nella classifica top 30. Il disco ottenne un discreto successo in tutte le parti del mondo e in particolare in [[Asia]] e [[Australia]].
-- Resets global counters
--
function ScribuntoUnit:init(frame)
self.frame = frame
self.successCount = 0
self.failureCount = 0
self.skipCount = 0
self.results = {}
end
 
Dopo aver firmato un nuovo contratto con la [[EMI]], Richard Marx pubblicò nel 2004 il disco ''[[My Own Best Enemy]]''. Dall'album furono estratti i singoli ''When You're Gone'' e ''Ready to Fly''.
-------------------------------------------------------------------------------
-- Runs a single testcase
-- @param name test nume
-- @param test function containing assertions
--
function ScribuntoUnit:runTest(suite, name, test)
local success, details = pcall(test, suite)
if success then
self.successCount = self.successCount + 1
table.insert(self.results, {name = name, success = true})
elseif type(details) ~= 'table' or not details.ScribuntoUnit then -- a real error, not a failed assertion
self.failureCount = self.failureCount + 1
table.insert(self.results, {name = name, error = true, message = 'Lua error -- ' .. tostring(details)})
elseif details.skipped then
self.skipCount = self.skipCount + 1
table.insert(self.results, {name = name, skipped = true})
else
self.failureCount = self.failureCount + 1
local message = details.source
if details.message then
message = message .. details.message .. "\n"
end
message = message .. details.text
table.insert(self.results, {name = name, error = true, message = message, expected = details.expected, actual = details.actual})
end
end
 
Nel 2008 uscì ''[[Duo (album)|Duo]]'', un disco suonato con il cantante dei [[Vertical Horizon]] [[Matt Scannell]]. Il progetto presentò le versioni acustiche dei maggiori successi di Marx e dei Vertical Horizon, oltre a un inedito intitolato ''Always on Your Mind''. Il disco non fu pubblicato da nessuna etichetta ma messo in vendita direttamente dal sito ufficiale di Marx. Seguirono concerti che videro i due artisti esibirsi assieme in varie città americane.
-------------------------------------------------------------------------------
-- Runs all tests and displays the results.
--
function ScribuntoUnit:runSuite(suite, frame)
self:init(frame)
local names = {}
for name in pairs(suite) do
if name:find('^test') then
table.insert(names, name)
end
end
table.sort(names) -- Put tests in alphabetical order.
for i, name in ipairs(names) do
local func = suite[name]
self:runTest(suite, name, func)
end
return {
successCount = self.successCount,
failureCount = self.failureCount,
skipCount = self.skipCount,
results = self.results,
}
end
 
Il 12 giugno 2008 Marx ha preso parte allo show televisivo "Songwriters In The Round Presents: Legends & Lyrics" nell'episodio 102 della prima serie al fianco di [[Kenny Loggins]], [[Nathan Lee]] e i [[Three Doors Down]]. La performance musicale è stata pubblicata in DVD.<ref>{{Cita web | url=http://www.legendsandlyrics.com/events/65 | editore=Legends and Lyrics/American Public Television | titolo=Episode 102/Season 1 | accesso=11 maggio 2009 | urlarchivio=https://web.archive.org/web/20090422175310/http://www.legendsandlyrics.com/events/65 | dataarchivio=22 aprile 2009 | urlmorto=sì }}</ref><ref>{{Cita web | url=http://www.legendsandlyrics.com/about | editore=Legends and Lyrics/American Public Television | titolo=About | accesso=11 maggio 2009 | urlarchivio=https://web.archive.org/web/20090420093019/http://www.legendsandlyrics.com/about | dataarchivio=20 aprile 2009 | urlmorto=sì }}</ref><ref>{{Cita web | url=http://www.legendsandlyrics.com/artists/Nathan_Lee | editore=Legends and Lyrics/American Public Television | titolo=Nathan Lee | accesso=11 maggio 2009 | urlarchivio=https://web.archive.org/web/20090611003416/http://www.legendsandlyrics.com/artists/Nathan_Lee | dataarchivio=11 giugno 2009 | urlmorto=sì }}</ref>
-------------------------------------------------------------------------------
-- #invoke entry point for running the tests.
-- Can be called without a frame, in which case it will use mw.log for output
-- @param displayMode see displayResults()
--
function ScribuntoUnit:run(suite, frame)
local testData = self:runSuite(suite, frame)
if frame then
return self:displayResults(testData, frame.args.displayMode or 'table')
else
return self:displayResults(testData, 'log')
end
end
 
Nel 2008 uscì ''[[Sundown (Richard Marx)|Sundown]]'' e nel 2009 ''[[Emotional Remains]]'', due nuovi album di scaricabili ancora una volta dal sito ufficiale dell'artista. La traccia ''Through My Veins'' è un tributo al padre Dick Marx, deceduto nel 1997.
-------------------------------------------------------------------------------
-- Displays test results
-- @param displayMode: 'table', 'log' or 'short'
--
function ScribuntoUnit:displayResults(testData, displayMode)
if displayMode == 'table' then
return self:displayResultsAsTable(testData)
elseif displayMode == 'log' then
return self:displayResultsAsLog(testData)
elseif displayMode == 'short' then
return self:displayResultsAsShort(testData)
else
error('unknown display mode')
end
end
 
== Discografia ==
function ScribuntoUnit:displayResultsAsLog(testData)
=== Album in studio ===
if testData.failureCount > 0 then
*1987 - ''[[Richard Marx (album)|Richard Marx]]'' (UK #68 - USA #8)
mw.log('FAILURES!!!')
*1989 - ''[[Repeat Offender]]'' (UK #8 - USA #1)
elseif testData.skipCount > 0 then
*1991 - ''[[Rush Street]]'' (UK #7 - USA #35)
mw.log('Some tests could not be executed without a frame and have been skipped. Invoke this test suite as a template to run all tests.')
*1994 - ''[[Paid Vacation]]'' (UK #11 - USA #37)
end
*1997 - ''[[Flesh and Bone (Richard Marx)|Flesh and Bone]]'' (USA #70)
mw.log(string.format('Assertions: success: %d, error: %d, skipped: %d', testData.successCount, testData.failureCount, testData.skipCount))
*2000 - ''[[Days in Avalon]]''
mw.log('-------------------------------------------------------------------------------')
*2004 - ''[[My Own Best Enemy]]'' (USA #126)
for _, result in ipairs(testData.results) do
*2008 - ''[[Sundown (Richard Marx)|Sundown]]''
if result.error then
*2009 - ''[[Emotional Remains]]''
mw.log(string.format('%s: %s', result.name, result.message))
*2012 - ''[[Christmas Spirit (Richard Marx)|Christmas Spirit]]'' (USA #181)
end
*2014 - ''[[Beautiful Goodbye]]'' (USA #39)
end
=== Raccolte ===
end
*1994 - ''Ballads''
*1997 - ''[[Greatest Hits (Richard Marx)|Greatest Hits]]'' (UK #34 - USA #140)
*2000 - ''The Best of Richard Marx''
*2000 - ''The Essential Richard Marx''
*2000 - ''Timeline''
*2008 - ''[[Duo (album)|Duo]]'' (con [[Matt Scannell]])
*2010 - ''[[Stories to Tell]]''
*2010 - ''Hits & Ballads''
*2012 - ''Inside My Head''
*2012 - ''Seven & Seven''
*2014 - ''Now and Forever - The Ballads''
*2016 - ''The Ultimate Collection''
=== Singoli ===
*1987 - ''Don't Mean Nothing'' (UK #78 - USA #3)
*1987 - ''Should've Known Better'' (UK #50 - USA #3)
*1987 - ''Lonely Heart'' (UK #60)
*1988 - ''Endless Summer Nights'' (UK #50 - USA #2)
*1988 - ''Hold On to the Nights'' (UK #60 - USA #1)
*1988 - ''Have Mercy''
*1989 - ''Satisfied'' (UK #52 - USA #1)
*1989 - ''Right Here Waiting'' (UK #2 - USA #1)
*1989 - ''Angelia'' (UK #45 - USA #4 - ITA #7)
*1989 - ''Nothing You Can Do About It''
*1990 - ''Too Late to Say Goodbye'' (UK #38 - USA #12)
*1990 - ''Children of the Night'' (UK #54 - USA #13)
*1991 - ''Hard To Believe'' (con [[Kevin Cronin]], [[Bill Champlin]] e [[David Crosby]])
*1991 - ''Keep Coming Back'' (UK #55 - USA #12)
*1992 - ''Hazard'' (UK #3 - USA #9)
*1992 - ''Take This Heart'' (UK #13 - USA #20)
*1992 - ''Chains Around My Heart'' (UK #29 - USA #44)
*1992 - ''Can't Help Falling In Love''
*1992 - ''Playing With Fire''
*1994 - ''Now and Forever'' (UK #13 - USA #7)
*1994 - ''Silent Scream'' (UK #32)
*1994 - ''The Way She Loves Me'' (UK #38 - USA #20)
*1995 - ''Nothing Left Behind Us'' (USA #74)
*1995 - ''Haunt Me Tonight'' (con [[Bruce Gaitsch]])
*1997 - ''Every Day Of Your Life'' (con [[Roch Voisine]])
*1997 - ''Until I Find You Again'' (UK #144 - USA #42)
*1997 - ''Touch Of Heaven''
*1997 - ''Every Day Of Your Life'' (con [[Aska]])
*1997 - ''At the Beginning'' (con [[Donna Lewis]]) (USA #45)
*1998 - ''Slipping Away''
*1998 - ''Thanks To You''
*1998 - ''Angel's Lullaby''
*1999 - ''The Last Words You Said'' (con [[Sarah Brightman]])
*2000 - ''Days in Avalon''
*2001 - ''Straight From My Heart''
*2004 - ''When You're Gone''
*2005 - ''Nothing Left To Say''
*2005 - ''Ready to Fly''
*2010 - ''Everybody''
*2011 - ''When You Loved Me''
*2011 - ''When Love Is All You've Got'' (con [[George Canyon]])
*2011 - ''Christmas Spirit''
*2012 - ''Wouldn't Let Me Love You''
*2012 - ''Santa Claus Is Coming To Town'' (con [[Sara Niemietz]])
*2012 - ''Little Drummer Boy''
*2012 - ''Christmas Mornings''
*2012 - ''O Holy Night''
*2013 - ''Just Go''
*2013 - ''All Through The Night'' (con [[Heart]])
*2014 - ''Turn Off The Night''
*2014 - ''Whatever We Started''
*2014 - ''Beautiful Goodbye''
*2016 - ''Last Thing I Wanted''
 
== Note ==
-- TODO l10n
<references />
 
== Collegamenti esterni ==
function ScribuntoUnit:displayResultsAsShort(testData)
* {{Collegamenti esterni}}
local text = string.format('success: %d, error: %d, skipped: %d', testData.successCount, testData.failureCount, testData.skipCount)
* {{cita web|http://www.richardmarx.com|RichardMarx.com}}
if testData.failureCount > 0 then
* [https://myspace.com/officialrichardmarx Pagina di Richard Marx] su [[MySpace]]
text = '<span class="error">' .. text .. '</span>'
end
return text
end
 
{{Richard Marx}}
function ScribuntoUnit:displayResultsAsTable(testData)
{{Controllo di autorità}}
local successIcon, failIcon = self.frame:preprocess('{{SI}}'), self.frame:preprocess('{{NO}}')
{{Portale|biografie|rock}}
local text = ''
if testData.failureCount > 0 then
local msg = "'''$1 {{PLURAL:$1|test|tests}} failed'''."
msg = mw.message.newRawMessage(msg, testData.failureCount):plain()
msg = self.frame:preprocess(msg)
text = text .. failIcon .. ' ' .. msg .. '\n'
else
local msg = "'''All tests passed'''."
text = text .. successIcon .. ' ' .. msg .. '\n'
end
text = text .. '{| class="wikitable scribunto-test-table"\n'
text = text .. '!\n! Name\n! Expected\n! Actual\n'
for _, result in ipairs(testData.results) do
text = text .. '|-\n'
if result.error then
text = text .. '| ' .. failIcon .. '\n| ' .. result.name .. '\n| '
if (result.expected and result.actual) then
text = text .. mw.text.nowiki(tostring(result.expected)) .. '\n| ' .. mw.text.nowiki(tostring(result.actual)) .. '\n'
else
text = text .. ' colspan="2" | ' .. mw.text.nowiki(result.message) .. '\n'
end
else
text = text .. '| ' .. successIcon .. '\n| ' .. result.name .. '\n|\n|\n'
end
end
text = text .. '|}\n'
return text
end
 
return ScribuntoUnit