mirror of
https://github.com/gnosygnu/xowa.git
synced 2025-06-13 12:54:14 +00:00
Dev: Fix failing tests after project rebuild [#826]
This commit is contained in:
parent
4a7bd19056
commit
aeef520228
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
*.iml
|
*.iml
|
||||||
|
**/.idea/**
|
||||||
|
@ -13,18 +13,20 @@ The terms of each license can be found in the source code repository:
|
|||||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||||
*/
|
*/
|
||||||
package gplx;
|
package gplx;
|
||||||
import org.junit.*; import gplx.core.tests.*; import gplx.core.envs.*;
|
import org.junit.*; import gplx.core.tests.*; import gplx.core.envs.*;
|
||||||
public class Io_url__tst {
|
public class Io_url__tst {
|
||||||
@Before public void init() {fxt.Clear();} private final Io_url__fxt fxt = new Io_url__fxt();
|
@Before public void init() {fxt.Clear();} private final Io_url__fxt fxt = new Io_url__fxt();
|
||||||
@Test public void Basic__lnx() {fxt.Test__New__http_or_null(Bool_.N, "file:///C:/a.txt", "C:/a.txt");}
|
@Test public void Basic__lnx() {fxt.Test__New__http_or_null(Bool_.N, "file:///C:/a.txt", "C:/a.txt");}
|
||||||
@Test public void Basic__wnt() {fxt.Test__New__http_or_null(Bool_.Y, "file:///C:/a.txt", "C:\\a.txt");}
|
@Test public void Basic__wnt() {fxt.Test__New__http_or_null(Bool_.Y, "file:///C:/a.txt", "C:\\a.txt");}
|
||||||
@Test public void Null() {fxt.Test__New__http_or_null(Bool_.N, "C:/a.txt", null);}
|
@Test public void Null() {fxt.Test__New__http_or_null(Bool_.N, "C:/a.txt", null);}
|
||||||
}
|
}
|
||||||
class Io_url__fxt {
|
class Io_url__fxt {
|
||||||
public void Clear() {Io_mgr.Instance.InitEngine_mem();}
|
public void Clear() {Io_mgr.Instance.InitEngine_mem();}
|
||||||
public void Test__New__http_or_null(boolean os_is_wnt, String raw, String expd) {
|
public void Test__New__http_or_null(boolean os_is_wnt, String raw, String expd) {
|
||||||
Op_sys.Cur_(os_is_wnt ? Op_sys.Tid_wnt : Op_sys.Tid_lnx);
|
int curTid = Op_sys.Cur().Tid();
|
||||||
Gftest.Eq__obj_or_null(expd, Io_url_.New__http_or_null(raw));
|
Op_sys.Cur_(os_is_wnt ? Op_sys.Tid_wnt : Op_sys.Tid_lnx);
|
||||||
}
|
Gftest.Eq__obj_or_null(expd, Io_url_.New__http_or_null(raw));
|
||||||
}
|
Op_sys.Cur_(curTid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
XOWA: the XOWA Offline Wiki Application
|
XOWA: the XOWA Offline Wiki Application
|
||||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
Copyright (C) 2012-2020 gnosygnu@gmail.com
|
||||||
|
|
||||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||||
or alternatively under the terms of the Apache License Version 2.0.
|
or alternatively under the terms of the Apache License Version 2.0.
|
||||||
@ -13,51 +13,56 @@ The terms of each license can be found in the source code repository:
|
|||||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||||
*/
|
*/
|
||||||
package gplx.xowa.htmls.core.htmls.tidy; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.*; import gplx.xowa.htmls.core.htmls.*;
|
package gplx.xowa.htmls.core.htmls.tidy;
|
||||||
import gplx.core.envs.*;
|
|
||||||
import java.io.ByteArrayInputStream;
|
import gplx.core.envs.Op_sys;
|
||||||
import java.io.ByteArrayOutputStream;
|
import org.junit.Before;
|
||||||
import org.w3c.tidy.Tidy;
|
import org.junit.Test;
|
||||||
import org.junit.*;
|
import org.w3c.tidy.Tidy;
|
||||||
public class Xoh_tidy_wkr_jtidy_tst {
|
|
||||||
@Before public void init() {fxt.Clear();} private Jtidy_fxt fxt = new Jtidy_fxt();
|
import java.io.ByteArrayInputStream;
|
||||||
@Test public void Image_full() {
|
import java.io.ByteArrayOutputStream;
|
||||||
String nl = Op_sys.Cur().Tid_is_wnt() ? "\r\n" : "\n"; // NOTE: JTidy uses different line-endings based on OS; DATE:2015-05-11
|
|
||||||
fxt.Test_tidy("<a href='http://𐎍𐎁_𐎜'>𐎍𐎁_𐎜</a>", "<a href='http://%F0%90%8E%8D%F0%90%8E%81_%F0%90%8E%9C'>𐎍𐎁_𐎜</a>" + nl);
|
public class Xoh_tidy_wkr_jtidy_tst {
|
||||||
}
|
private Jtidy_fxt fxt = new Jtidy_fxt();
|
||||||
}
|
@Before public void init() {fxt.Clear();}
|
||||||
class Jtidy_fxt {
|
@Test public void Image_full() {
|
||||||
public void Clear() {
|
String nl = Op_sys.Cur().Tid_is_wnt() ? "\r\n" : "\n"; // NOTE: JTidy uses different line-endings based on OS; DATE:2015-05-11
|
||||||
}
|
fxt.Test_tidy("<a href='http://𐎍𐎁_𐎜'>𐎍𐎁_𐎜</a>", "<a href='http://%F0%90%8E%8D%F0%90%8E%81_%F0%90%8E%9C'>𐎍𐎁_𐎜</a>" + nl);
|
||||||
public void Test_tidy(String raw, String expd) {
|
}
|
||||||
Tidy tidy = new Tidy();
|
}
|
||||||
tidy.setPrintBodyOnly(true);
|
class Jtidy_fxt {
|
||||||
tidy.setWraplen(0);
|
public void Clear() {
|
||||||
tidy.setQuiet(true);
|
}
|
||||||
tidy.setShowWarnings(false);
|
public void Test_tidy(String raw, String expd) {
|
||||||
tidy.setShowErrors(0);
|
Tidy tidy = new Tidy();
|
||||||
ByteArrayInputStream rdr = null;
|
tidy.setPrintBodyOnly(true);
|
||||||
try {
|
tidy.setWraplen(0);
|
||||||
rdr = new ByteArrayInputStream(raw.getBytes("UTF-8"));
|
tidy.setQuiet(true);
|
||||||
} catch (Exception e) {}
|
tidy.setShowWarnings(false);
|
||||||
ByteArrayOutputStream wtr = new ByteArrayOutputStream();
|
tidy.setShowErrors(0);
|
||||||
tidy.parse(rdr, wtr);
|
ByteArrayInputStream rdr = null;
|
||||||
String actl = wtr.toString();
|
try {
|
||||||
Test_mgr.Eq_str(expd, actl);
|
rdr = new ByteArrayInputStream(raw.getBytes("UTF-8"));
|
||||||
}
|
} catch (Exception e) {}
|
||||||
}
|
ByteArrayOutputStream wtr = new ByteArrayOutputStream();
|
||||||
class Test_mgr {
|
tidy.parse(rdr, wtr);
|
||||||
public static void Eq_str(String expd, String actl) {
|
String actl = wtr.toString();
|
||||||
// byte[] expd_bry = Bry_.new_u8(expd);
|
Test_mgr.Eq_str(expd, actl);
|
||||||
// byte[] actl_bry = Bry_.new_u8(actl);
|
}
|
||||||
// int expd_len = expd_bry.length;
|
}
|
||||||
// int actl_len = actl_bry.length;
|
class Test_mgr {
|
||||||
// if (expd_len != actl_len) throw new RuntimeException(String.format("expd != actl; expd:%s actl:%s", Int_.To_str(expd_len), Int_.To_str(actl_len)));
|
public static void Eq_str(String expd, String actl) {
|
||||||
// for (int i = 0; i < expd_len; ++i) {
|
// byte[] expd_bry = Bry_.new_u8(expd);
|
||||||
// byte expd_byte = expd_bry[i];
|
// byte[] actl_bry = Bry_.new_u8(actl);
|
||||||
// byte actl_byte = actl_bry[i];
|
// int expd_len = expd_bry.length;
|
||||||
// if (expd_byte != actl_byte) throw new RuntimeException(String.format("expd != actl; %s expd:%s actl:%s", Int_.To_str(i), Byte_.To_str(expd_byte), Byte_.To_str(actl_byte)));
|
// int actl_len = actl_bry.length;
|
||||||
// }
|
// if (expd_len != actl_len) throw new RuntimeException(String.format("expd != actl; expd:%s actl:%s", Int_.To_str(expd_len), Int_.To_str(actl_len)));
|
||||||
if (!expd.equals(actl)) throw new RuntimeException(String.format("expd != actl; expd:%s actl:%s", expd, actl));
|
// for (int i = 0; i < expd_len; ++i) {
|
||||||
}
|
// byte expd_byte = expd_bry[i];
|
||||||
}
|
// byte actl_byte = actl_bry[i];
|
||||||
|
// if (expd_byte != actl_byte) throw new RuntimeException(String.format("expd != actl; %s expd:%s actl:%s", Int_.To_str(i), Byte_.To_str(expd_byte), Byte_.To_str(actl_byte)));
|
||||||
|
// }
|
||||||
|
if (!expd.equals(actl)) throw new RuntimeException(String.format("expd != actl; expd:%s actl:%s", expd, actl));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
XOWA: the XOWA Offline Wiki Application
|
XOWA: the XOWA Offline Wiki Application
|
||||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||||
|
|
||||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||||
or alternatively under the terms of the Apache License Version 2.0.
|
or alternatively under the terms of the Apache License Version 2.0.
|
||||||
|
|
||||||
You may use XOWA according to either of these licenses as is most appropriate
|
You may use XOWA according to either of these licenses as is most appropriate
|
||||||
for your project on a case-by-case basis.
|
for your project on a case-by-case basis.
|
||||||
|
|
||||||
The terms of each license can be found in the source code repository:
|
The terms of each license can be found in the source code repository:
|
||||||
|
|
||||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||||
*/
|
*/
|
||||||
package gplx.xowa.htmls.core.wkrs.tocs; import gplx.*; import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.*; import gplx.xowa.htmls.core.wkrs.*;
|
package gplx.xowa.htmls.core.wkrs.tocs; import gplx.*;
|
||||||
|
import gplx.core.envs.Op_sys;
|
||||||
|
import gplx.xowa.*; import gplx.xowa.htmls.*; import gplx.xowa.htmls.core.*; import gplx.xowa.htmls.core.wkrs.*;
|
||||||
import org.junit.*; import gplx.xowa.htmls.core.makes.tests.*; import gplx.xowa.parsers.lnkis.*;
|
import org.junit.*; import gplx.xowa.htmls.core.makes.tests.*; import gplx.xowa.parsers.lnkis.*;
|
||||||
public class Xoh_toc_make__basic__tst {
|
public class Xoh_toc_make__basic__tst {
|
||||||
private final Xoh_make_fxt fxt = new Xoh_make_fxt();
|
private final Xoh_make_fxt fxt = new Xoh_make_fxt();
|
||||||
@ -51,6 +53,7 @@ public class Xoh_toc_make__basic__tst {
|
|||||||
fxt.Test__make(orig, fxt.Page_chkr().Body_(expd));
|
fxt.Test__make(orig, fxt.Page_chkr().Body_(expd));
|
||||||
}
|
}
|
||||||
@Test public void Disabled_if_drd() {
|
@Test public void Disabled_if_drd() {
|
||||||
|
int curTid = Op_sys.Cur().Tid();
|
||||||
gplx.core.envs.Op_sys.Cur_(gplx.core.envs.Op_sys.Tid_drd);
|
gplx.core.envs.Op_sys.Cur_(gplx.core.envs.Op_sys.Tid_drd);
|
||||||
String expd = String_.Concat_lines_nl_skip_last
|
String expd = String_.Concat_lines_nl_skip_last
|
||||||
( "abc"
|
( "abc"
|
||||||
@ -62,5 +65,6 @@ public class Xoh_toc_make__basic__tst {
|
|||||||
, "b 1"
|
, "b 1"
|
||||||
);
|
);
|
||||||
fxt.Test__make(orig, fxt.Page_chkr().Body_(expd));
|
fxt.Test__make(orig, fxt.Page_chkr().Body_(expd));
|
||||||
|
Op_sys.Cur_(curTid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
|
||||||
<classpathentry combineaccessrules="false" kind="src" path="/100_core"/>
|
|
||||||
<classpathentry combineaccessrules="false" kind="src" path="/140_dbs"/>
|
|
||||||
<classpathentry combineaccessrules="false" kind="src" path="/150_gfui"/>
|
|
||||||
<classpathentry combineaccessrules="false" kind="src" path="/400_xowa"/>
|
|
||||||
<classpathentry kind="lib" path="C:/000/200_dev/110_java/lib/junit.jar"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
|
||||||
</classpath>
|
|
BIN
lib/hamcrest-core-1.3.jar
Normal file
BIN
lib/hamcrest-core-1.3.jar
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user