forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
928 B
35 lines
928 B
6 years ago
|
/**
|
||
|
* Created by windy on 2018/01/23.
|
||
|
*/
|
||
|
describe("aliasFunctionTest", function () {
|
||
|
|
||
6 years ago
|
before(function () {
|
||
|
BI.specialCharsMap = {
|
||
|
"\\\\": "0",
|
||
|
".": "1",
|
||
|
"/": "2"
|
||
|
};
|
||
|
});
|
||
|
|
||
6 years ago
|
/**
|
||
|
* test_author_windy
|
||
|
*/
|
||
6 years ago
|
it("htmlEncode和htmlDecode", function () {
|
||
6 years ago
|
|
||
|
var targetString = "<a>1 2&</a>";
|
||
|
var encodeString = BI.htmlEncode(targetString);
|
||
|
expect(encodeString).to.equal("<a>1 2&</a>");
|
||
|
expect(BI.htmlDecode(encodeString)).to.equal(targetString);
|
||
|
});
|
||
6 years ago
|
|
||
|
/**
|
||
|
* test_author_windy
|
||
|
*/
|
||
|
it("encodeURIComponent和decodeURIComponent", function () {
|
||
|
var targetString = "tableName./\\";
|
||
|
var encodeString = BI.encodeURIComponent(targetString);
|
||
|
expect(encodeString).to.equal("tableName120");
|
||
|
expect(BI.decodeURIComponent(encodeString)).to.equal(targetString);
|
||
|
});
|
||
6 years ago
|
});
|