Jump to content

Template:Sfn Legifrance/testcases

From Wikipedia, the free encyclopedia

Important note: if you're used to using the {{test case}} template, you know that when live and sandbox results differ, the bar goes yellow to flag the difference. That is not the case here. The reason is, that the template tests the rendered code, and the template under testing {{Sfn Legifrance}} generates references, and these are not rendered in situ, but only in the references section at the end, where the {{test case}} template doesn't see them, and cannot flag an error. The only thing rendered in situ and therefore discoverable by the testcase comparison, is the superscript number[3], but that's not where the real action is. So most errors will not be trapped by a change in bar color. Therefore, when evaluating pass/fail status of a test, you must follow the bracketed numerical citations to the references section, and compare the content of the live-generated and sandbox-generated footnotes, to see if they are identical. Bottom line: the bar color means nothing on this page for most tests.

Basic tests

[edit]
Test 1a: using standard args 1, 2, and 3
{{Sfn Legifrance|CPP|62-2|CPP Art. 62-2}}

{{Sfn Legifrance}}

Assertion 1a.[1]

{{Sfn Legifrance/sandbox}}

Assertion 1a.[1]

Test 1b - base=JORF, long text
{{Sfn Legifrance|JORF|INPA2020854X|Composition de l'assemblée ''Composition of the Assembly'', 4 August 2020}}

{{Sfn Legifrance}}

Assertion 1b.[2]

{{Sfn Legifrance/sandbox}}

Assertion 1b.[2]

Test 1c: default 'text' param from base + number
{{Sfn Legifrance|CPP|62-2}}

{{Sfn Legifrance}}

Assertion 1c.[3]

{{Sfn Legifrance/sandbox}}

Assertion 1c.[3]

Test 1d: with url and param 3 (text) params
{{Sfn Legifrance|JORF|57-1426|Loi n° 57-1426 du 31 décembre 1957|url=https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000692469}}

{{Sfn Legifrance}}

Assertion 1d.[4]

{{Sfn Legifrance/sandbox}}

Assertion 1d.[4]

Test 1e: url and param 3 override any value of base and number:
{{Sfn Legifrance|CPP|123-456-7890|Loi n° 57-1426 du 31 décembre 1957 |url=https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000692469}}

{{Sfn Legifrance}}

Assertion 1e.[4]

{{Sfn Legifrance/sandbox}}

Assertion 1e.[4]

Test 1f: url and param 3 only, empty 1 and 2
{{Sfn Legifrance| | |Law #57-1426 of December 31, 1957|url=https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000692469}}

{{Sfn Legifrance}}

Assertion 1f.[5]

{{Sfn Legifrance/sandbox}}

Assertion 1f.[5]

Param alias

[edit]
Test 2a: using standard args 1, 2, and 'text' instead of '3'
{{Sfn Legifrance|CPP|62-2|text=CPP Art. 62-2}}

{{Sfn Legifrance}}

Assertion 2a.[1]

{{Sfn Legifrance/sandbox}}

Assertion 2a.[1]

Test 2b - base=JORF, long text param
{{Sfn Legifrance|JORF|57-1426|Loi n° 57-1426 du 31 décembre 1957|url=https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000692469}}

{{Sfn Legifrance}}

Assertion 2b.[4]

{{Sfn Legifrance/sandbox}}

Assertion 2b.[4]

There is no Test 2c.

Intentionally blank.

Test 2d: with url and text params
{{Sfn Legifrance|text=Composition de l'assemblée ''Composition of the Assembly'', 4 August 2020}}

{{Sfn Legifrance}}

Assertion 2d.Sfn Legifrance: missing 'base' param

{{Sfn Legifrance/sandbox}}

Assertion 2d.Sfn Legifrance: missing 'base' param

There is no Test 2e.

Intentionally blank.

Test 2f: url and text only, different code base
{{Sfn Legifrance|text=Law #57-1426 of December 31, 1957 |url=https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000692469}}

{{Sfn Legifrance}}

Assertion 2f.[5]

{{Sfn Legifrance/sandbox}}

Assertion 2f.[5]

Test 2g: text only gives a 'loc' field in the citation but it's unlniked. (requires change to {{Legifrance}})
{{Sfn Legifrance|text=Law #57-1426 of December 31, 1957}}

{{Sfn Legifrance}}

Assertion 2g.Sfn Legifrance: missing 'base' param

{{Sfn Legifrance/sandbox}}

Assertion 2g.Sfn Legifrance: missing 'base' param

Error cases

[edit]
Test 3a: missing param 2/number
{{Sfn Legifrance|CPP|CPP Art. 62-2}}

{{Sfn Legifrance}}

Assertion 3a.[6]

{{Sfn Legifrance/sandbox}}

Assertion 3a.[6]

Test 3b: invalid 'base' value
{{Sfn Legifrance|TWEEDLEDUM|62-2|CPP Art. 62-2}}

{{Sfn Legifrance}}

Assertion 3b.[7]

{{Sfn Legifrance/sandbox}}

Assertion 3b.[7]

Test 3c: missing 'base' param
{{Sfn Legifrance|62-2|CPP Art. 62-2}}

{{Sfn Legifrance}}

Assertion 3c.[8]

{{Sfn Legifrance/sandbox}}

Assertion 3c.[8]

Test 3d: like test 1e above, but base is ignored, even if the value is bad.
{{Sfn Legifrance|BAD-BASE|123-456-7890|Loi n° 57-1426 du 31 décembre 1957|url=https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000692469}}

{{Sfn Legifrance}}

Assertion 3d.[4]

{{Sfn Legifrance/sandbox}}

Assertion 3d.[4]

Base code expansion tests

[edit]
Test 4a: CPP-1
{{Sfn Legifrance|CPP|1}}

{{Sfn Legifrance}}

Assertion 4a.[9]

{{Sfn Legifrance/sandbox}}

Assertion 4a.[9]

Test 4b: CPP-20
{{Sfn Legifrance|CPP|20}}

{{Sfn Legifrance}}

Assertion 4b.[10]

{{Sfn Legifrance/sandbox}}

Assertion 4b.[10]

Test 4c: CCOM
{{Sfn Legifrance|CCOM|420-2}}

{{Sfn Legifrance}}

Assertion 4c.[11]

{{Sfn Legifrance/sandbox}}

Assertion 4c.[11]

Test 4d: JORF
{{Sfn Legifrance|JORF|JUSX9800048L}}

{{Sfn Legifrance}}

Assertion 4d.[12]

{{Sfn Legifrance/sandbox}}

Assertion 4d.[12]

Test 4e: CGCT
{{Sfn Legifrance|CGCT|2212-2}}

{{Sfn Legifrance}}

Assertion 4e.[13]

{{Sfn Legifrance/sandbox}}

Assertion 4e.[13]

Test 4f: CP
{{Sfn Legifrance|CP|111-2}}

{{Sfn Legifrance}}

Assertion 4f.[14]

{{Sfn Legifrance/sandbox}}

Assertion 4f.[14]

Test 4g: CP-112
{{Sfn Legifrance|CP|112-1}}

{{Sfn Legifrance}}

Assertion 4g.[15]

{{Sfn Legifrance/sandbox}}

Assertion 4g.[15]

Base code expansion with 'lang'

[edit]
Test 5a: CPP-1
{{Sfn Legifrance|CPP|1|lang=fr}}

{{Sfn Legifrance}}

Assertion 5a.[16]

{{Sfn Legifrance/sandbox}}

Assertion 5a.[16]

Test 5b: CPP-20
{{Sfn Legifrance|CPP|20|lang=fr}}

{{Sfn Legifrance}}

Assertion 5b.[17]

{{Sfn Legifrance/sandbox}}

Assertion 5b.[17]

Test 5c: CCOM
{{Sfn Legifrance|CCOM|420-2|lang=fr}}

{{Sfn Legifrance}}

Assertion 5c.[18]

{{Sfn Legifrance/sandbox}}

Assertion 5c.[18]

Test 5d: JORF
{{Sfn Legifrance|JORF|JUSX9800048L|lang=fr}}

{{Sfn Legifrance}}

Assertion 5d.[19]

{{Sfn Legifrance/sandbox}}

Assertion 5d.[19]

Test 5e: CGCT
{{Sfn Legifrance|CGCT|2212-2|lang=fr}}

{{Sfn Legifrance}}

Assertion 5e.[20]

{{Sfn Legifrance/sandbox}}

Assertion 5e.[20]

Test 5f: CP
{{Sfn Legifrance|CP|111-2|lang=fr}}

{{Sfn Legifrance}}

Assertion 5f.[21]

{{Sfn Legifrance/sandbox}}

Assertion 5f.[21]

Test 5g: CP-112
{{Sfn Legifrance|CP|112-1|lang=fr}}

{{Sfn Legifrance}}

Assertion 5g.[22]

{{Sfn Legifrance/sandbox}}

Assertion 5g.[22]

Test 5h: CPP-1 (lang=en)
{{Sfn Legifrance|CPP|1|lang=en}}

{{Sfn Legifrance}}

Assertion 5a.[9]

{{Sfn Legifrance/sandbox}}

Assertion 5a.[9]

Test 5i: CPP-20 (lang=en)
{{Sfn Legifrance|CPP|20|lang=en}}

{{Sfn Legifrance}}

Assertion 5b.[10]

{{Sfn Legifrance/sandbox}}

Assertion 5b.[10]

Test 5j: CCOM (lang=en)
{{Sfn Legifrance|CCOM|420-2|lang=en}}

{{Sfn Legifrance}}

Assertion 5c.[11]

{{Sfn Legifrance/sandbox}}

Assertion 5c.[11]


References

[edit]

Note: some tests above which are testing invalid param values should generate errors in the citations below.

Works cited

This citation provides linkage from the citations generated by the templates --> République française; Secrétariat général du gouvernement (19 October 2022). "Légifrance Le service public de la diffusion du droit" [The public service for dissemination of the law]. Légifrance. Direction de l'information légale et administrative. ISSN 2270-8987. OCLC 867599055.

Citations