value-class-pattern-tests: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(Break test cases out into separate page)
 
(added newly created value class pattern date and time value tests, conversion notes from a collection of inline tests to individual test pages marked up with test-fixture)
Line 1: Line 1:
We require a thorough test-suite for the [[value-class-pattern]], but in the interim, here is an incomplete test suite:
With the goal of developing a thorough test-suite for the [[value-class-pattern]], here are some test cases:


==Conforming <code>value-title</code> Tests==
== test cases ==
The following value-class-pattern test cases have been developed (all of which use the [[test-fixture]] poshformat for easier extraction).


===One===
=== Date and time values ===
{{main|value-class-date-time-tests}}
* [[value-dt-test-YYYY-MM-DD--HH-MM]]
* [[value-dt-test-abbr-YYYY-MM-DD--HH-MM]]
* ...
 
=== Parsing value from a title attribute ===
* ...
 
== inline tests ==
Here are inline tests developed during the development and design of the [[value-class-pattern]]. Each of those tests needs to be updated as follows:
 
# move to a separate page (one test per page), similar to the format used by [[value-dt-test-YYYY-MM-DD--HH-MM]].
# mark up using the [[test-fixture]] poshformat. 
# "Result" at a minimum converted from abstract hierarchical text properties/values to an [[vCard]] and/or [[iCalendar]] expected result block.
# linked to from the previous section.
 
Please help the value class pattern testing, development, and implementation effort by updating the following tests accordingly:
 
===Conforming <code>value-title</code> Tests===
 
====One====


<source lang=html4strict>
<source lang=html4strict>
Line 21: Line 43:
</source>
</source>


===Two===
====Two====


<source lang=html4strict>
<source lang=html4strict>
Line 46: Line 68:
</source>
</source>


==Tests of Non-Conforming <code>value-title</code> Code==
===Tests of Non-Conforming <code>value-title</code> Code===


===One===
====One====


In this case, the human text appears before the <code>value-title</code> element, so the machine-data value has a weaker association with the property declaration. The likelihood of the data not being maintained correctly — the data value being ignored by an editor — is increased.
In this case, the human text appears before the <code>value-title</code> element, so the machine-data value has a weaker association with the property declaration. The likelihood of the data not being maintained correctly — the data value being ignored by an editor — is increased.
Line 69: Line 91:
</source>
</source>


===Two===
====Two====


In this case, the <code>value-title</code> element is used for a property that is not valid for use with this pattern.
In this case, the <code>value-title</code> element is used for a property that is not valid for use with this pattern.
Line 87: Line 109:
     SUMMARY = BarCamp
     SUMMARY = BarCamp
</source>
</source>
== see also ==
* [[value-class-pattern]]
* [[value-class-date-time-tests]]
* [[test-fixture]]

Revision as of 00:04, 7 July 2009

With the goal of developing a thorough test-suite for the value-class-pattern, here are some test cases:

test cases

The following value-class-pattern test cases have been developed (all of which use the test-fixture poshformat for easier extraction).

Date and time values

Main article: value-class-date-time-tests

Parsing value from a title attribute

  • ...

inline tests

Here are inline tests developed during the development and design of the value-class-pattern. Each of those tests needs to be updated as follows:

  1. move to a separate page (one test per page), similar to the format used by value-dt-test-YYYY-MM-DD--HH-MM.
  2. mark up using the test-fixture poshformat.
  3. "Result" at a minimum converted from abstract hierarchical text properties/values to an vCard and/or iCalendar expected result block.
  4. linked to from the previous section.

Please help the value class pattern testing, development, and implementation effort by updating the following tests accordingly:

Conforming value-title Tests

One

<p class='tel'>My 
    <span class='type'>
        <span class='value-title' title='cell'> </span>mobile
    </span> phone number is <span class='value'>+44 1245 333 333</span>
</p>

Result

TEL
    TYPE = cell
    VALUE = +44 1245 333 333

Two

<p class='vevent'>
    My <span class='summary'>Birthday Party</span> will be held
    <span class='dtstart'>
        <span class='value-title' title='2009-04-01'>tomorrow</span>
    </span>
    and last until 
    <span class='dtend'>
        <span class='value-title' title='2009-04-05'> </span>
        the following Tuesday (April 5th)
    </span>.
</p>

Result

VEVENT
    SUMMARY = Birthday Party
    DTSTART = 2009-04-01
    DTEND = 2009-04-05

Tests of Non-Conforming value-title Code

One

In this case, the human text appears before the value-title element, so the machine-data value has a weaker association with the property declaration. The likelihood of the data not being maintained correctly — the data value being ignored by an editor — is increased.

<p class='tel'>My 
    <span class='type'>
        mobile
        <span class='value-title' title='cell'> </span>
    </span> phone number is <span class='value'>+44 1245 333 333</span>
</p>

Result

TEL
    TYPE = none/default/unknown ('mobile' is unknown in hCard)
    VALUE = +44 1245 333 333

Two

In this case, the value-title element is used for a property that is not valid for use with this pattern.

<p class='vevent'>You are invited to
    <span class='summary'>
        <span class='value-title' title='FooCamp'> </span>
        BarCamp
    </span>

Result

VEVENT
    SUMMARY = BarCamp

see also