Err_Utl_tst.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. XOWA: the XOWA Offline Wiki Application
  3. Copyright (C) 2012-2017 gnosygnu@gmail.com
  4. XOWA is licensed under the terms of the General Public License (GPL) Version 3,
  5. or alternatively under the terms of the Apache License Version 2.0.
  6. You may use XOWA according to either of these licenses as is most appropriate
  7. for your project on a case-by-case basis.
  8. The terms of each license can be found in the source code repository:
  9. GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
  10. Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
  11. */
  12. package gplx;
  13. import gplx.objects.primitives.BoolUtl;
  14. import org.junit.Test;
  15. public class Err_Utl_tst {
  16. private final Err_fxt fxt = new Err_fxt();
  17. @Test public void Trace_to_str__gplx() {
  18. fxt.Test_Trace_to_str(BoolUtl.Y, BoolUtl.N, 0, String_.Concat_lines_nl_skip_last
  19. ( "gplx.Err_.new_wo_type(Err_.java:1)" // ignore this line
  20. , "gplx.String_.Len(String_.java:2)"
  21. ), String_.Concat_lines_nl_skip_last
  22. ( ""
  23. , " gplx.String_.Len(String_.java:2)"
  24. ));
  25. }
  26. @Test public void Trace_to_str__gplx_ignore() {
  27. fxt.Test_Trace_to_str(BoolUtl.Y, BoolUtl.N, 1, String_.Concat_lines_nl_skip_last
  28. ( "gplx.Err_.new_wo_type(Err_.java:1)" // ignore this line
  29. , "gplx.String_.Fail(String_.java:2)" // ignore this line also
  30. , "gplx.String_.Len(String_.java:3)"
  31. ), String_.Concat_lines_nl_skip_last
  32. ( ""
  33. , " gplx.String_.Len(String_.java:3)"
  34. ));
  35. }
  36. }
  37. class Err_fxt {
  38. public void Test_Trace_to_str(boolean is_gplx, boolean called_by_log, int ignore_lines, String trace, String expd) {
  39. String actl = Err.Trace_to_str(is_gplx, called_by_log, ignore_lines, trace);
  40. Tfds.Eq_str_lines(expd, actl);
  41. }
  42. }