File: testaliases.txt

package info (click to toggle)
icu 78.2-1
  • links: PTS
  • area: main
  • in suites: experimental
  • size: 123,992 kB
  • sloc: cpp: 527,891; ansic: 112,789; sh: 4,983; makefile: 4,657; perl: 3,199; python: 2,933; xml: 749; sed: 36; lisp: 12
file content (67 lines) | stat: -rw-r--r-- 2,645 bytes parent folder | download | duplicates (37)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//*******************************************************************************
//*
//*   Copyright (C) 2002-2015, International Business Machines
//*   Corporation and others.  All Rights Reserved.
//*
//*******************************************************************************


// This is a test resource to check whether the aliasing mechanism works
// as advertised

testaliases:table(nofallback) 
{
    // This should produce an error - circular alias
    aaa:alias { "testaliases/aab" } // Test circular dependency protection
    aab:alias { "testaliases/aaa" }

    // aliasing nonexist position
    nonexisting:alias { "/ICUDATA/ja" }

    // aliasing to another resource
    simplealias:alias { "testtypes/menu/file/open" } // simple referencing

    // alias that uses another alias and references parts of the end structure
    referencingalias:alias { "testaliases/anotheralias/2" } // Referencing through another alias
    anotheralias:alias { "/ICUDATA/ja_JP/calendar/gregorian/DateTimePatterns" } // Provoke a fallback too

    DateTimePatterns:alias { "/ICUDATA/ja/calendar/gregorian/DateTimePatterns" }

    // aliasing using position
    boundaries:alias { "/ICUDATA-brkitr/th" } // Referencing corresponding resource in another bundle

    // aliasing arrays
    zoneTests {
        zoneAlias:alias { "/ICUDATA-zone/en/zoneStrings" } // Referencing by index
        zoneAlias1:alias { "/ICUDATA-zone/en/zoneStrings/3" } // Referencing by index
        zoneAlias2:alias { "/ICUDATA-zone/en/zoneStrings/3/0" } // Referencing by index
    }

    // Test aliasing parts of an array using position
    zoneStrings { 
        :alias { "/ICUDATA/en" } 
        :alias { "/ICUDATA/en" } 
    }
    // WARNING: this test assumes that on all platforms digits sort normally
    // if not, the test may fail
    testGetStringByKeyAliasing {
        KeyAlias0PST:alias { "te/zoneStrings/2/0" } //"America/Los_Angeles",
        KeyAlias1PacificStandardTime:alias { "te/zoneStrings/2/1" } //"Pacific Standard Time",
        KeyAlias2PDT:alias { "te/zoneStrings/2/4" } //"PDT",
        KeyAlias3LosAngeles:alias { "te/zoneStrings/2/5" } //"Los Angeles",
    }
    testGetStringByIndexAliasing  {
        :alias { "te/zoneStrings/2/0" } //"America/Los_Angeles",
        :alias { "te/zoneStrings/2/1" } //"Pacific Standard Time",
        :alias { "te/zoneStrings/2/4" } //"PDT",
        :alias { "te/zoneStrings/2/5" } //"Los Angeles",
    }
    testAliasToTree:alias{"/ICUDATA-coll/en/collations"}

}

//eof