65eabfbf404755cc606170f9f5e663fc6f55e58e
[m17n/m17n-lib-cs.git] / M17N.cs
1 using System;
2 using M17N.Core;
3
4 public class Test
5 {
6   static void symbol_test ()
7   {
8     MSymbol sym1, sym2;
9
10     Console.WriteLine ("### Symbol test ###");
11     sym1 = new MSymbol ("abc");
12     Console.WriteLine (sym1.ToString ());
13     sym2 = new MSymbol ("abc");
14     Console.WriteLine (sym2.ToString ());
15     Console.WriteLine (sym1 == sym2 ? "OK" : "NO");
16     sym1.put (MSymbol.nil, MSymbol.t);
17
18     MPlist p = new MPlist ();
19
20     p.put (MSymbol.t, sym1);
21     p.push (MSymbol.t, sym2);
22
23     MPlist pp = new MPlist ();
24     pp.put (MSymbol.t, p);
25     Console.WriteLine (pp.ToString ());
26     Console.WriteLine (p.get (MSymbol.t));
27   }
28
29   static void mtext_test ()
30   {
31     MText mt;
32
33     Console.WriteLine ("### MText test ###");
34     mt = new MText ("abc");
35     Console.WriteLine (mt);
36     Console.WriteLine (mt + new MText ("def"));
37     mt += new MText ("ghi");
38     Console.WriteLine (mt);    
39   }
40
41   static void mtext_property_test ()
42   {
43     Console.WriteLine ("### MTextProperty test ###");
44   }
45
46   public static void Main()
47   {
48     symbol_test ();
49     mtext_test ();
50     mtext_property_test ();
51   }
52
53 }