(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System / Test / System / uri-test-generator.cs
blob79f26d273eccbec7d00b8e06d235e6176e8cc86f
1 //
2 // uri-test-generator.cs : URI test result generator.
3 //
4 // Author:
5 // Atsushi Enomoto <atushi@ximian.com>
6 //
7 // (C)2003 Novell inc.
8 //
9 // See test-uri-list.txt for usage.
11 using System;
12 using System.IO;
13 using System.Text;
15 namespace MonoTests.System
17 public class UriTestGenerator
19 public static void Main (string [] args)
21 StreamReader sr = new StreamReader ("test-uri-list.txt", Encoding.UTF8);
22 StreamWriter sw = new StreamWriter ("test-uri-props.txt", false, Encoding.UTF8);
24 GenerateResult (sr, sw, null);
26 sr = new StreamReader ("test-uri-relative-list.txt", Encoding.UTF8);
27 sw = new StreamWriter ("test-uri-relative-props.txt", false, Encoding.UTF8);
29 Uri baseUri = new Uri ("http://www.go-mono.com");
30 GenerateResult (sr, sw, baseUri);
33 public static void GenerateResult (TextReader sr, TextWriter sw, Uri baseUri)
35 while (sr.Peek () > 0) {
36 string uriString = sr.ReadLine ();
37 if (uriString.Length == 0 || uriString [0] == '#')
38 continue;
39 Uri uri = (baseUri == null) ?
40 new Uri (uriString) : new Uri (baseUri, uriString);
42 sw.WriteLine ("-------------------------");
43 sw.WriteLine (uriString);
44 sw.WriteLine (uri.ToString ());
45 sw.WriteLine (uri.AbsoluteUri);
46 sw.WriteLine (uri.Scheme);
47 sw.WriteLine (uri.Host);
48 sw.WriteLine (uri.LocalPath);
49 sw.WriteLine (uri.Query);
50 sw.WriteLine (uri.Port);
51 sw.WriteLine (uri.IsFile);
52 sw.WriteLine (uri.IsUnc);
53 sw.WriteLine (uri.IsLoopback);
54 sw.WriteLine (uri.UserEscaped);
55 sw.WriteLine (uri.HostNameType);
56 sw.WriteLine (uri.AbsolutePath);
57 sw.WriteLine (uri.PathAndQuery);
58 sw.WriteLine (uri.Authority);
59 sw.WriteLine (uri.Fragment);
60 sw.WriteLine (uri.UserInfo);
61 sw.Flush ();
63 sr.Close ();
64 sw.Close ();