Merge pull request #5382 from kumpera/pedump_fix
[mono.git] / mono / tests / switch-string.cs
1 using System;
2
3 public class fall_through {
4
5         static void test (string str) {
6                         Console.WriteLine("testing: '{0}', interned: {1}", str, String.IsInterned(str) != null);
7
8                         switch(str)
9                         {
10                                 case "test":
11                                         Console.WriteLine("passed");
12                                         break;
13
14                                 default:
15                                         return;
16                         }
17         }
18         public static void Main(string[] args)
19         {
20                 char[] c = {'t', 'e', 's', 't'};
21                 string s = new String (c);
22                 string s2 = new String (c);
23                 Console.WriteLine("testing built string (interned = {0}) (equal strings: {1})", String.IsInterned(s) != null, (object)s == (object)s2);
24                 test (s);
25                 Console.WriteLine("after test 1 (interned = {0}) (equal strings: {1})", String.IsInterned(s) != null, (object)s == (object)s2);
26                 Console.WriteLine("after test (interned = {0}) (interned2 = {1})", String.IsInterned(s) != null, String.IsInterned(s2) != null);
27                 foreach(string str in args)
28                 {
29                         test (str);
30                 }
31         }
32 }
33