[Docs] [txt|pdf|xml] [Tracker] [Email] [Nits]

Versions: 00 01 02

PRECIS                                                         S. Whited
Internet-Draft                                                Individual
Intended status: Standards Track                      September 18, 2018
Expires: March 22, 2019


 Preparation, Enforcement, and Comparison of Internationalized Strings
                         (PRECIS) Test Vectors
                  draft-whited-precis-test-vectors-00

Abstract

   This document contains machine readable test vectors for several
   Preparation, Enforcement, and Comparison of Internationalized Strings
   (PRECIS) profiles.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on March 22, 2019.

Copyright Notice

   Copyright (c) 2018 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.




Whited                   Expires March 22, 2019                 [Page 1]


Internet-Draft                PRECIS: Tests               September 2018


Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Overview  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.2.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Test Vectors  . . . . . . . . . . . . . . . . . . . . . . . .   3
     2.1.  Methodology . . . . . . . . . . . . . . . . . . . . . . .   3
     2.2.  Enforcement Tests . . . . . . . . . . . . . . . . . . . .   3
       2.2.1.  Basic . . . . . . . . . . . . . . . . . . . . . . . .   3
       2.2.2.  Context Rule 1  . . . . . . . . . . . . . . . . . . .   3
       2.2.3.  Context Rule 2  . . . . . . . . . . . . . . . . . . .   4
       2.2.4.  Context Rule 3  . . . . . . . . . . . . . . . . . . .   5
       2.2.5.  Context Rule 4  . . . . . . . . . . . . . . . . . . .   5
       2.2.6.  Context Rule 5+6  . . . . . . . . . . . . . . . . . .   5
       2.2.7.  Context Rule 7  . . . . . . . . . . . . . . . . . . .   6
       2.2.8.  Context Rule 8+9  . . . . . . . . . . . . . . . . . .   6
       2.2.9.  Nickname  . . . . . . . . . . . . . . . . . . . . . .   7
       2.2.10. OpaqueString  . . . . . . . . . . . . . . . . . . . .   8
       2.2.11. UsernameCaseMapped  . . . . . . . . . . . . . . . . .   8
       2.2.12. UsernameCasePreserved . . . . . . . . . . . . . . . .  10
     2.3.  Comparison Tests  . . . . . . . . . . . . . . . . . . . .  10
       2.3.1.  Nickname  . . . . . . . . . . . . . . . . . . . . . .  10
   3.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  11
   4.  Security Considerations . . . . . . . . . . . . . . . . . . .  11
   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  11
   Appendix A.  Acknowledgements . . . . . . . . . . . . . . . . . .  11
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  11

1.  Introduction

1.1.  Overview

   This document contains machine readable test vectors for several
   Preparation, Enforcement, and Comparison of Internationalized Strings
   (PRECIS) [RFC8264] profiles.

   Two sets of vectors exist for profiles of the base classes.  The
   first set tests the preparation and enforcement steps.  It takes the
   form of a table that contains an input string, an output string after
   the PRECIS preparation step, and an output string after the PRECIS
   enforcement step, and an optional comment.  If either step is
   expected to error, the output string will be "ERROR".  The second set
   tests the PRECIS comparison step.  It takes the form of a table that
   contains two strings, a boolean that is TRUE if the two strings
   should be considered equal and FALSE otherwise, and an optional
   comment.





Whited                   Expires March 22, 2019                 [Page 2]


Internet-Draft                PRECIS: Tests               September 2018


   Vectors for inclusion of code points in the IdentifierClass and
   FreeformClass are not included.  A complete list of valid inputs and
   Outputs for the derived property algorithm specified in [RFC8264] can
   be found in the IANA "PRECIS Derived Property Value" registry.

1.2.  Terminology

   Many important terms used in this document are defined in [RFC8264],
   [RFC6365], and [Unicode].

2.  Test Vectors

2.1.  Methodology

   The test vectors in this document have been verified by three
   independent implementations.  An implementation that concurs with the
   results provided in this document should be interoperable with other
   implementations.

   Input and output strings are expressed as UTF-8 and hexidecimal
   encoded byte strings.

2.2.  Enforcement Tests

2.2.1.  Basic

                      +------------+----------+-----+
                      | Input      | Output   | Err |
                      +------------+----------+-----+
                      | 65cc81cc9f | c3a9cc9f |     |
                      +------------+----------+-----+

2.2.2.  Context Rule 1

   +----------------------------+----------------------------+---------+
   | Input                      | Output                     | Err     |
   +----------------------------+----------------------------+---------+
   | e2808c                     |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | e2808c61                   |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | 61e2808c                   |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | e2808cd8a7                 |                            | context |
   |                            |                            | rule vi |



Whited                   Expires March 22, 2019                 [Page 3]


Internet-Draft                PRECIS: Tests               September 2018


   |                            |                            | olated  |
   | d8ace2808c                 |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | d890e2808cd890d8a7         |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | d8acd890e2808cd890         |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | d8ace2808cd8a7             | d8ace2808cd8a7             |         |
   | d8acd890e2808cd890d8a7     | d8acd890e2808cd890d8a7     |         |
   | d8acd890d890e2808cd890d890 | d8acd890d890e2808cd890d890 |         |
   | d8a7                       | d8a7                       |         |
   | d8acd890e2808cd8a7         | d8acd890e2808cd8a7         |         |
   | d8ace2808cd890d8a7         | d8ace2808cd890d8a7         |         |
   | eaa1b2e2808cd8ac           | eaa1b2e2808cd8ac           |         |
   | eaa1b2d890e2808cd890d8ac   | eaa1b2d890e2808cd890d8ac   |         |
   | eaa1b2d890d890e2808cd890d8 | eaa1b2d890d890e2808cd890d8 |         |
   | 90d8ac                     | 90d8ac                     |         |
   | eaa1b2d890e2808cd8ac       | eaa1b2d890e2808cd8ac       |         |
   | eaa1b2e2808cd890d8ac       | eaa1b2e2808cd890d8ac       |         |
   | e0a98de2808c               | e0a98de2808c               |         |
   | eaa1b2e0a98de2808c         | eaa1b2e0a98de2808c         |         |
   | eaa1b2e0a98dd890e2808c     |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | eaa1b2e0a98dd890e2808c     |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | e0ab8de2808c               | e0ab8de2808c               |         |
   | eaa1b2e0ab8de2808c         | eaa1b2e0ab8de2808c         |         |
   | eaa1b2e0ab8dd890e2808c     |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | eaa1b2e0ab8dd890e2808c     |                            | context |
   |                            |                            | rule vi |
   |                            |                            | olated  |
   | eaa1b2e0ab8de2808cd8ac     | eaa1b2e0ab8de2808cd8ac     |         |
   | eaa1b2e2808ce0ab8dd8ac     | eaa1b2e2808ce0ab8dd8ac     |         |
   +----------------------------+----------------------------+---------+

2.2.3.  Context Rule 2








Whited                   Expires March 22, 2019                 [Page 4]


Internet-Draft                PRECIS: Tests               September 2018


    +--------------------+--------------------+-----------------------+
    | Input              | Output             | Err                   |
    +--------------------+--------------------+-----------------------+
    | e2808d             |                    | context rule violated |
    | e2808d61           |                    | context rule violated |
    | 61e2808d           |                    | context rule violated |
    | e0a98de2808d       | e0a98de2808d       |                       |
    | eaa1b2e0a98de2808d | eaa1b2e0a98de2808d |                       |
    | e0a98d61e2808d     |                    | context rule violated |
    +--------------------+--------------------+-----------------------+

2.2.4.  Context Rule 3

          +--------------+--------------+-----------------------+
          | Input        | Output       | Err                   |
          +--------------+--------------+-----------------------+
          | c2b7         |              | context rule violated |
          | 6cc2b7       |              | context rule violated |
          | c2b76c       |              | context rule violated |
          | 61c2b7       |              | context rule violated |
          | 6cc2b761     |              | context rule violated |
          | 61c2b761     |              | context rule violated |
          | 6cc2b76c     | 6cc2b76c     |                       |
          | 616cc2b76c61 | 616cc2b76c61 |                       |
          +--------------+--------------+-----------------------+

2.2.5.  Context Rule 4

      +------------------+------------------+-----------------------+
      | Input            | Output           | Err                   |
      +------------------+------------------+-----------------------+
      | cdb5             |                  | context rule violated |
      | cdb561           |                  | context rule violated |
      | ceb1cdb5         |                  | context rule violated |
      | cdb5ceb1         | cdb5ceb1         |                       |
      | ceb1cdb5ceb1     | ceb1cdb5ceb1     |                       |
      | cdb5cdb5ceb1     | cdb5cdb5ceb1     |                       |
      | ceb1cdb5cdb5ceb1 | ceb1cdb5cdb5ceb1 |                       |
      | ceb1cdb5cdb5     |                  | context rule violated |
      | ceb1cdb5cdb561   |                  | context rule violated |
      +------------------+------------------+-----------------------+

2.2.6.  Context Rule 5+6








Whited                   Expires March 22, 2019                 [Page 5]


Internet-Draft                PRECIS: Tests               September 2018


    +--------------------+--------------------+-----------------------+
    | Input              | Output             | Err                   |
    +--------------------+--------------------+-----------------------+
    | d7b3               |                    | context rule violated |
    | d7b3d794           |                    | context rule violated |
    | 61d7b362           |                    | context rule violated |
    | d7a9d7b3           | d7a9d7b3           |                       |
    | d7a9d7b3d7b3d7b3   | d7a9d7b3d7b3d7b3   |                       |
    | d7b4               |                    | context rule violated |
    | d7b4d794           |                    | context rule violated |
    | 61d7b462           |                    | context rule violated |
    | d7a9d7b4           | d7a9d7b4           |                       |
    | d7a9d7b4d7b4d7b4   | d7a9d7b4d7b4d7b4   |                       |
    | 61d7a9d7b4d7b4d7b4 | 61d7a9d7b4d7b4d7b4 |                       |
    +--------------------+--------------------+-----------------------+

2.2.7.  Context Rule 7

   +------------------------+------------------------+-----------------+
   | Input                  | Output                 | Err             |
   +------------------------+------------------------+-----------------+
   | e383bb                 |                        | context rule    |
   |                        |                        | violated        |
   | 616263e383bb           |                        | context rule    |
   |                        |                        | violated        |
   | e383bb646566           |                        | context rule    |
   |                        |                        | violated        |
   | 616263e383bb646566     |                        | context rule    |
   |                        |                        | violated        |
   | 61e3838563e383bb646566 | 61e3838563e383bb646566 |                 |
   | 616263e383bb64e381b666 | 616263e383bb64e381b666 |                 |
   | e2ba906263e383bb646566 | e2ba906263e383bb646566 |                 |
   +------------------------+------------------------+-----------------+

2.2.8.  Context Rule 8+9

   +--------------------------+----------------------+-----------------+
   | Input                    | Output               | Err             |
   +--------------------------+----------------------+-----------------+
   | d9a1d9a2d9a3d9a4d9a5dbb6 |                      | context rule    |
   |                          |                      | violated        |
   | dbb1dbb2dbb3dbb4dbb5d9a6 |                      | context rule    |
   |                          |                      | violated        |
   | d9a1d9a2d9a3d9a4d9a5     | d9a1d9a2d9a3d9a4d9a5 |                 |
   | dbb1dbb2dbb3dbb4dbb5     | dbb1dbb2dbb3dbb4dbb5 |                 |
   +--------------------------+----------------------+-----------------+





Whited                   Expires March 22, 2019                 [Page 6]


Internet-Draft                PRECIS: Tests               September 2018


2.2.9.  Nickname

   +--------------------------------------+---------------------+------+
   | Input                                | Output              | Err  |
   +--------------------------------------+---------------------+------+
   | 20205377616e20206f6620202041766f6e20 | 5377616e206f6620417 |      |
   | 2020                                 | 66f6e               |      |
   |                                      |                     | disa |
   |                                      |                     | llow |
   |                                      |                     | ed e |
   |                                      |                     | mpty |
   |                                      |                     | stri |
   |                                      |                     | ng   |
   | 20                                   |                     | disa |
   |                                      |                     | llow |
   |                                      |                     | ed e |
   |                                      |                     | mpty |
   |                                      |                     | stri |
   |                                      |                     | ng   |
   | 2020                                 |                     | disa |
   |                                      |                     | llow |
   |                                      |                     | ed e |
   |                                      |                     | mpty |
   |                                      |                     | stri |
   |                                      |                     | ng   |
   | 61c2a061e19a8061e2808061e2808161e280 | 6120612061206120612 |      |
   | 8261e2808361e2808461e2808561e2808661 | 0612061206120612061 |      |
   | e2808761e2808861e2808961e2808a61e280 | 2061206120612061206 |      |
   | af61e2819f61e3808061                 | 120612061           |      |
   | 466f6f                               | 466f6f              |      |
   | 666f6f                               | 666f6f              |      |
   | 466f6f20426172                       | 466f6f20426172      |      |
   | 666f6f20626172                       | 666f6f20626172      |      |
   | cea3                                 | cea3                |      |
   | cf83                                 | cf83                |      |
   | cf82                                 | cf82                |      |
   | e2999a                               | e2999a              |      |
   | 5269636861726420e285a3               | 5269636861726420495 |      |
   |                                      | 6                   |      |
   | e284ab                               | c385                |      |
   | efac80                               | 6666                |      |
   | d7a961                               | d7a961              |      |
   | eb8f99ec9dbceca1b0eab1b4ebb380eab2bd | eb8f99ec9dbceca1b0e |      |
   | ed9788eb9dbd                         | ab1b4ebb380eab2bded |      |
   |                                      | 9788eb9dbd          |      |
   +--------------------------------------+---------------------+------+





Whited                   Expires March 22, 2019                 [Page 7]


Internet-Draft                PRECIS: Tests               September 2018


2.2.10.  OpaqueString

   +--------------------------------------+---------------------+------+
   | Input                                | Output              | Err  |
   +--------------------------------------+---------------------+------+
   | 20205377616e20206f6620202041766f6e20 | 20205377616e20206f6 |      |
   | 2020                                 | 620202041766f6e2020 |      |
   |                                      | 20                  |      |
   |                                      |                     | disa |
   |                                      |                     | llow |
   |                                      |                     | ed e |
   |                                      |                     | mpty |
   |                                      |                     | stri |
   |                                      |                     | ng   |
   | 20                                   | 20                  |      |
   | 2020                                 | 2020                |      |
   | 61c2a061e19a8061e2808061e2808161e280 | 6120612061206120612 |      |
   | 8261e2808361e2808461e2808561e2808661 | 0612061206120612061 |      |
   | e2808761e2808861e2808961e2808a61e280 | 2061206120612061206 |      |
   | af61e2819f61e3808061                 | 120612061           |      |
   | 466f6f                               | 466f6f              |      |
   | 666f6f                               | 666f6f              |      |
   | 466f6f20426172                       | 466f6f20426172      |      |
   | 666f6f20626172                       | 666f6f20626172      |      |
   | cf83                                 | cf83                |      |
   | 5269636861726420e285a3               | 5269636861726420e28 |      |
   |                                      | 5a3                 |      |
   | e284ab                               | c385                |      |
   | 4a61636b206f6620e299a673             | 4a61636b206f6620e29 |      |
   |                                      | 9a673               |      |
   | 6d7920636174206973206120096279       |                     | disa |
   |                                      |                     | llow |
   |                                      |                     | ed   |
   |                                      |                     | rune |
   | d7a961                               | d7a961              |      |
   +--------------------------------------+---------------------+------+

2.2.11.  UsernameCaseMapped

   +---------------------------+----------------------------+----------+
   | Input                     | Output                     | Err      |
   +---------------------------+----------------------------+----------+
   | 6a756c696574406578616d706 | 6a756c696574406578616d706c |          |
   | c652e636f6d               | 652e636f6d                 |          |
   | 6675737362616c6c          | 6675737362616c6c           |          |
   | 6675c39f62616c6c          | 6675c39f62616c6c           |          |
   | cf80                      | cf80                       |          |
   | cea3                      | cf83                       |          |



Whited                   Expires March 22, 2019                 [Page 8]


Internet-Draft                PRECIS: Tests               September 2018


   | cf83                      | cf83                       |          |
   | cf82                      | cf82                       |          |
   | 49                        | 69                         |          |
   | 49                        | 69                         |          |
   | cf92                      |                            | disallow |
   |                           |                            | ed rune  |
   | ceb0                      | ceb0                       |          |
   | 666f6f20626172            |                            | disallow |
   |                           |                            | ed rune  |
   | e2999a                    |                            | failed   |
   |                           |                            | bidi     |
   |                           |                            | rule     |
   | 7e                        | 7e                         |          |
   | 61                        | 61                         |          |
   | 21                        | 21                         |          |
   | c2b2                      |                            | failed   |
   |                           |                            | bidi     |
   |                           |                            | rule     |
   | 09                        |                            | disallow |
   |                           |                            | ed rune  |
   | 0a                        |                            | disallow |
   |                           |                            | ed rune  |
   | e29b96                    |                            | failed   |
   |                           |                            | bidi     |
   |                           |                            | rule     |
   | e29bbf                    |                            | failed   |
   |                           |                            | bidi     |
   |                           |                            | rule     |
   | efac80                    |                            | disallow |
   |                           |                            | ed rune  |
   | e19a80                    |                            | failed   |
   |                           |                            | bidi     |
   |                           |                            | rule     |
   | 20                        |                            | disallow |
   |                           |                            | ed rune  |
   | 2020                      |                            | disallow |
   |                           |                            | ed rune  |
   | c785                      |                            | disallow |
   |                           |                            | ed rune  |
   | e19bae                    |                            | disallow |
   |                           |                            | ed rune  |
   | d288                      |                            | failed   |
   |                           |                            | bidi     |
   |                           |                            | rule     |
   | e284ab                    | c3a5                       |          |
   | 41cc8a                    | c3a5                       |          |
   | c385                      | c3a5                       |          |
   | c3a7                      | c3a7                       |          |



Whited                   Expires March 22, 2019                 [Page 9]


Internet-Draft                PRECIS: Tests               September 2018


   | 63cca7                    | c3a7                       |          |
   | c598                      | c599                       |          |
   | 52cc8c                    | c599                       |          |
   | e1b9a1                    | e1b9a1                     |          |
   | d090                      | d0b0                       |          |
   | efbca1efbca2              | 6162                       |          |
   | d7a963                    |                            | failed   |
   |                           |                            | bidi     |
   |                           |                            | rule     |
   +---------------------------+----------------------------+----------+

2.2.12.  UsernameCasePreserved

               +--------------+--------+------------------+
               | Input        | Output | Err              |
               +--------------+--------+------------------+
               | 414243       | 414243 |                  |
               | efbca1efbca2 | 4142   |                  |
               | d7a963       |        | failed bidi rule |
               | efac80       |        | disallowed rune  |
               | e284ab       | c385   |                  |
               | e1ba9b       |        | disallowed rune  |
               +--------------+--------+------------------+

2.3.  Comparison Tests

2.3.1.  Nickname

   +-----------------------------------+----------------------+--------+
   | A                                 | B                    | Result |
   +-----------------------------------+----------------------+--------+
   | 61                                | 62                   | false  |
   | 20205377616e20206f6620202041766f6 | 7377616e206f66206176 | true   |
   | e202020                           | 6f6e                 |        |
   | 466f6f                            | 666f6f               | true   |
   | 666f6f                            | 666f6f               | true   |
   | 466f6f20426172                    | 666f6f20626172       | true   |
   | 666f6f20626172                    | 666f6f20626172       | true   |
   | cea3                              | cf83                 | true   |
   | cea3                              | cf82                 | false  |
   | cf83                              | cf82                 | false  |
   | 5269636861726420e285a3            | 72696368617264206976 | true   |
   | e284ab                            | c3a5                 | true   |
   | efac80                            | 6666                 | true   |
   | c39f                              | 7353                 | false  |
   | c2a8                              | 20cc88               | false  |
   | 20cc88                            | cc88                 | true   |
   +-----------------------------------+----------------------+--------+



Whited                   Expires March 22, 2019                [Page 10]


Internet-Draft                PRECIS: Tests               September 2018


3.  IANA Considerations

   This document requires no interaction with the Internet Assigned
   Numbers Authority (IANA).

4.  Security Considerations

   This document is intended to provide test vectors for the PRECIS
   framework and its profiles.  No assertion of the security of the
   PRECIS framework or its profiles for any particular use is intended.
   The reader is referred to [RFC8264] for a discussion of the general
   security of the PRECIS framework.

5.  References

   [RFC6365]  Hoffman, P. and J. Klensin, "Terminology Used in
              Internationalization in the IETF", BCP 166, RFC 6365,
              DOI 10.17487/RFC6365, September 2011,
              <https://www.rfc-editor.org/info/rfc6365>.

   [RFC8264]  Saint-Andre, P. and M. Blanchet, "PRECIS Framework:
              Preparation, Enforcement, and Comparison of
              Internationalized Strings in Application Protocols",
              RFC 8264, DOI 10.17487/RFC8264, October 2017,
              <https://www.rfc-editor.org/info/rfc8264>.

   [Unicode]  The Unicode Consortium, "The Unicode Standard",
              <http://www.unicode.org/versions/latest/>.

Appendix A.  Acknowledgements

   The author would like to thank Marcel van Lohuizen of Google for his
   help and code reviews on the Go programming language implementation
   of PRECIS for which these tests were designed and for contributing
   many of the tests himself.  Also, Peter Saint-Andre for his
   encouragement on this document.

Author's Address

   Sam Whited
   Individual

   Email: sam@samwhited.com
   URI:   https://blog.samwhited.com/







Whited                   Expires March 22, 2019                [Page 11]


Html markup produced by rfcmarkup 1.129c, available from https://tools.ietf.org/tools/rfcmarkup/