Bump corefx
[mono-project.git] / mono / tests / switch-string.cs
blob4cc45f884df9cb3cf493a9ae3122c5f590060539
1 using System;
3 public class fall_through {
5 static void test (string str) {
6 Console.WriteLine("testing: '{0}', interned: {1}", str, String.IsInterned(str) != null);
8 switch(str)
10 case "test":
11 Console.WriteLine("passed");
12 break;
14 default:
15 return;
18 public static void Main(string[] args)
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)
29 test (str);