Toggle menu
14
229
69
27.1K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Refer to
Module:Diff



-- Unit tests for [[Module:Diff]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_no_change()
	self:preprocess_equals('{{#invoke:Diff|main|no change|no change}}', '<table class="diff" style="width:100%"><tr><td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;">−</td><td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"><div style="word-wrap: break-word; direction: ltr;">no change</div></td><td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;">+</td><td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"><div style="word-wrap: break-word; direction: ltr;">no change</div></td></tr></table>')
end

function p:test_one_change()
	self:preprocess_equals('{{#invoke:Diff|main|one change|a change}}', '<table class="diff" style="width:100%"><tr><td class="diff-marker" style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;">−</td><td class="diff-deletedline" style="border-color: #ffe49c; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"><div style="word-wrap: break-word; direction: ltr;"><del class="diffchange diffchange-inline" style="background: #feeec8; padding: 0.25em 0; font-weight: bold; text-decoration: initial;">one</del>&#32;change</div></td><td style="width: 2%; padding: 0.25em; font-weight: bold;font-size: 1.25em; text-align: end;">+</td><td class="diff-addedline" style="border-color: #a3d3ff; width: 48%; border-style: solid; border-radius: 0.33em; padding: 0.33em 0.5em; font-size: 1em; font-family: monospace; white-space: pre-wrap; border-width: 1px 1px 1px 4px; -webkit-border-end-width: 1px; -webkit-border-start-width: 4px; -moz-border-end-width: 1px; -moz-border-start-width: 4px;"><div style="word-wrap: break-word; direction: ltr;"><ins class="diffchange diffchange-inline" style="background: #d8ecff; padding: 0.25em 0; font-weight: bold; text-decoration: initial;">a</ins>&#32;change</div></td></tr></table>')
end

return p