Jump to content

Template:Resratio/testcases

From Wikipedia, the free encyclopedia
Empty Ratio
  • {{Resratio}}0
  • {{Resratio/sandbox}}0
Float Ratio, 1 digit
  • {{Resratio|1.3}} → 1.3
  • {{Resratio/sandbox|1.3}} → 1.3
Float Ratio, 2 digits
  • {{Resratio|1.33}}4∶3
  • {{Resratio/sandbox|1.33}}4∶3
Float Ratio, 3 digits
  • {{Resratio|1.333}}4∶3
  • {{Resratio/sandbox|1.333}}4∶3
Float Ratio, 4 digits
  • {{Resratio|1.3333}}4∶3
  • {{Resratio/sandbox|1.3333}}4∶3
Float Ratio, 2 digits with rounding error
  • {{Resratio|1.34}} → 1.34
  • {{Resratio/sandbox|1.34}} → 1.34
Colon Ratio, width > height
  • {{Resratio|4:3}}4∶3
  • {{Resratio/sandbox|4:3}}4∶3
Colon Ratio, height > width
  • {{Resratio|3:4}} → 3:4
  • {{Resratio/sandbox|3:4}} → 3:4
Colon Ratio, unnecessary factor to achieve y=9
  • {{Resratio|12:9}}4∶3
  • {{Resratio/sandbox|12:9}}4∶3
Colon Ratio, unnecessary factor to achieve x=16
  • {{Resratio|16:12}}4∶3
  • {{Resratio/sandbox|16:12}}4∶3
Unsupported Colon Ratio
  • {{Resratio|23:7}} → 23:7
  • {{Resratio/sandbox|23:7}} → 23:7
Width-Height Ratio, 4:3
  • {{Resratio|x=4 |y=3}}4∶3
  • {{Resratio/sandbox|x=4 |y=3}}4∶3
Width-Height Ratio, VGA
  • {{Resratio|x=640 |y=480}}4∶3
  • {{Resratio/sandbox|x=640 |y=480}}4∶3
Width-Height Ratio, single digit
  • {{Resratio|x=1.3 |y=1}} → 5.8546795155817E+15∶4.5035996273705E+15
  • {{Resratio/sandbox|x=1.3 |y=1}} → 1.3∶1
Width-Height Ratio, double digit
  • {{Resratio|x=1.33 |y=1.00}}4∶3
  • {{Resratio/sandbox|x=1.33 |y=1.00}}4∶3
Width-Height Ratio, quadruple digit
  • {{Resratio|x=1.3333 |y=1.0000}}4∶3
  • {{Resratio/sandbox|x=1.3333 |y=1.0000}}4∶3
Unsupported Width-Height Ratio
  • {{Resratio|x=23 |y=7}} → 23∶7
  • {{Resratio/sandbox|x=23 |y=7}} → 23∶7
Unsupported Width-Height Ratio as float
  • {{Resratio|f=true |x=23 |y=7}} → 3.2857
  • {{Resratio/sandbox|f=true |x=23 |y=7}} → 23∶7
Unsupported Width-Height Ratio that can be simplified
  • {{Resratio|x=905 |y=500}} → 181∶100
  • {{Resratio/sandbox|x=905 |y=500}} → 181∶100
Empty Ratio, 1
  • {{Resratio|}}xy
  • {{Resratio/sandbox|}}xy
Empty Ratio, 1 & 2
  • {{Resratio||}}x
  • {{Resratio/sandbox||}}xy
Zero Ratio, x
  • {{Resratio|x=0}}0
  • {{Resratio/sandbox|x=0}}0
Zero Ratio, y
  • {{Resratio|y=0}} → 0
  • {{Resratio/sandbox|y=0}} → 0
Zero Ratio, x & y
  • {{Resratio|x=0 |y=0}}0
  • {{Resratio/sandbox|x=0 |y=0}}0
Zero Ratio, 1 & 2
  • {{Resratio|0|0}}0
  • {{Resratio/sandbox|0|0}}0
Redundant parameters
  • {{Resratio|1|2|x=3 |y=4}} → 3∶4
  • {{Resratio/sandbox|1|2|x=3 |y=4}} → 3∶4
Named Ratio
  • {{Resratio|phi}}ϕ∶1
  • {{Resratio/sandbox|phi}}ϕ∶1
Named Ratio
  • {{Resratio|Golden}}ϕ∶1
  • {{Resratio/sandbox|Golden}}ϕ∶1
Named Ratio
  • {{Resratio|φ}}ϕ∶1
  • {{Resratio/sandbox|φ}}ϕ∶1
Named Ratio
  • {{Resratio|plastic}}ρ∶1
  • {{Resratio/sandbox|plastic}}ρ∶1
Named Ratio
  • {{Resratio|platin}} → platin
  • {{Resratio/sandbox|platin}} → platin
Named Ratio
  • {{Resratio|sqrt2}}√2∶1
  • {{Resratio/sandbox|sqrt2}}√2∶1


Old test cases from {{Ratio}}

[edit]

Tests that should yield 1∶1

[edit]
{{Resratio|1}}
1∶1 1∶1
{{Resratio|1:1}}
1∶1 1∶1
{{Resratio|~1:1}}
~1:1 ~1:1
{{Resratio|-1:1}}
-1:1 -1:1
{{Resratio|1|}}
1∶1 1∶1
{{Resratio|1.000|}}
1∶1 1∶1
{{Resratio|1:1|}}
1∶1 1∶1
{{Resratio|1.0}}
1∶1 1∶1
{{Resratio|1.00}}
1∶1 1∶1
{{Resratio|1.000}}
1∶1 1∶1
{{Resratio|1.0000}}
1∶1 1∶1
{{Resratio|1|1}}
1∶1 1∶1
{{Resratio|1.0|1.0}}
1∶1 1∶1
{{Resratio|1.0|1}}
1∶1 1∶1
{{Resratio|1|1.0}}
1∶1 1∶1
{{Resratio|1.000|1}}
1∶1 1∶1
{{Resratio|0.999999}}
1∶1 1∶1
{{Resratio|0.99999}}
1∶1 1∶1
{{Resratio|0.9999}}
1∶1 1∶1
{{Resratio|0.999}}
0.999 0.999
{{Resratio|1.000001}}
1∶1 1∶1
{{Resratio|1.00001}}
1∶1 1∶1
{{Resratio|1.0001}}
1∶1 1∶1
{{Resratio|1.001}}
1.001 1.001
{{Resratio|1|f=}}
1∶1 1∶1
{{Resratio|1||f=}}
1∶1 1∶1

Tests that should not yield 1∶1

[edit]
{{Resratio|1,000}}
1,000 1,000
{{Resratio|0.9990}}
0.9990 0.9990
{{Resratio|0.99}}
0.99 0.99
{{Resratio|0.9}}
0.9 0.9
{{Resratio|1.0009}}
1.0009 1.0009
{{Resratio|1.01}}
1.01 1.01
{{Resratio|1.1}}
11∶10 11∶10
{{Resratio|1|f}}
1∶1 1∶1
{{Resratio|1|f|}}
1∶1 1∶1
{{Resratio|1|f=yes}}
1 1
{{Resratio|1|f=on}}
1 1
{{Resratio|1|f=true}}
1 1
{{Resratio|1|f=1}}
1∶1 1
{{Resratio|1|f=0}}
1 1
{{Resratio|1|f=no}}
1 1
{{Resratio|1|f=off}}
1 1
{{Resratio|1|f=false}}
1 1

Tests that should yield 4∶3

[edit]
{{Resratio|~4:3}}
~4:3 ~4:3
{{Resratio|-4:3}}
-4:3 -4:3
{{Resratio|4:3}}
4∶3 4∶3
{{Resratio|8:6}}
4∶3 4∶3
{{Resratio|12:9}}
4∶3 4∶3
{{Resratio|16:12}}
4∶3 4∶3
{{Resratio|4|3}}
4∶3 4∶3
{{Resratio|12|9}}
4∶3 4∶3
{{Resratio|16|12}}
4∶3 4∶3
{{Resratio|20|15}}
4∶3 4∶3
{{Resratio|1.33}}
4∶3 4∶3
{{Resratio|1.333}}
4∶3 4∶3
{{Resratio|1.334}}
4∶3 4∶3
{{Resratio|x=4 |y=3}}
4∶3 4∶3
{{Resratio|4|y=3}}
4∶3 4∶3
{{Resratio|x=4 |y=3}}
4∶3 4∶3

Tests that should not yield 4∶3

[edit]
{{Resratio|1.3}}
1.3 1.3
{{Resratio|1.332}}
1.332 1.332
{{Resratio|1.3330}}
4∶3 4∶3
{{Resratio|1.34}}
1.34 1.34
{{Resratio|1.4}}
7∶5 7∶5
{{Resratio|x=3 |y=4}}
3∶4 3∶4
{{Resratio|x=3 |y=4}}
3∶4 3∶4
{{Resratio|3|x=4}}
4∶1 4∶1
{{Resratio|4|x=3}}
3∶1 3∶1