01: /*
02: * Regression tests for ArrayHelper
03: * Copyright (C) 2005 Stephen Ostermiller
04: * http://ostermiller.org/contact.pl?regarding=Java+Utilities
05: *
06: * This program is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU General Public License as published by
08: * the Free Software Foundation; either version 2 of the License, or
09: * (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * See COPYING.TXT for details.
17: */
18: package com.Ostermiller.util;
19:
20: /**
21: * Regression test for ArrayHelper. When run, this program
22: * should nothing unless an error occurs.
23: *
24: * More information about this class is available from <a target="_top" href=
25: * "http://ostermiller.org/utils/ArrayHelper.html">ostermiller.org</a>.
26: *
27: * @author Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
28: * @since ostermillerutils 1.06.00
29: */
30: class ArrayHelperTests {
31:
32: /**
33: * Test via command line
34: * @param args command line arguments (ignored)
35: */
36: public static void main(String args[]) {
37: try {
38: String[] arr = (String[]) ArrayHelper.cat(new String[] {
39: "one", "two", "three" }, new String[] { "four",
40: "five", "six" });
41: if (!ArrayHelper.equal(arr, new String[] { "one", "two",
42: "three", "four", "five", "six" })) {
43: throw new Exception("Arrays are not equal");
44: }
45: } catch (Exception x) {
46: x.printStackTrace();
47: System.exit(1);
48: }
49: System.exit(0);
50: }
51: }
|