File: state.vala

package info (click to toggle)
libkkc 0.3.5-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,904 kB
  • sloc: ansic: 7,099; makefile: 917; cpp: 435; python: 231; sh: 124
file content (34 lines) | stat: -rw-r--r-- 869 bytes parent folder | download | duplicates (6)
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
class StateTests : Kkc.TestCase {
    public StateTests () {
        base ("State");

        add_test ("properties", this.test_properties);
    }

    void test_properties () {
        Kkc.LanguageModel model = Kkc.LanguageModel.load ("text3");
        var state = new Kkc.State (model, new Kkc.DictionaryList ());
        Kkc.InputMode mode;
        Kkc.PunctuationStyle style;
        Kkc.Rule rule;
        state.get ("input-mode", out mode,
                   "punctuation-style", out style,
                   "typing-rule", out rule);
        state.set ("input-mode", mode,
                   "punctuation-style", style,
                   "typing-rule", rule);
    }
}

int main (string[] args)
{
  Test.init (ref args);
  Kkc.init ();

  TestSuite root = TestSuite.get_root ();
  root.add_suite (new StateTests ().get_suite ());

  Test.run ();

  return 0;
}