Skip to content

Commit

Permalink
Item1724: clean up test cases
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x00@4128 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
ArthurClemens authored and ArthurClemens committed Jun 14, 2009
1 parent 9b6cb65 commit b068880
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 1,083 deletions.
22 changes: 14 additions & 8 deletions core/data/TestCases/TestCaseJavascriptFiles.txt
@@ -1,10 +1,10 @@
%META:TOPICINFO{author="ProjectContributor" date="1111930902" format="1.0" version="$Rev: 7490 $"}%
%META:TOPICINFO{author="ProjectContributor" date="1111930902" format="1.0" version="$Rev: 1340 $"}%

---+!! Unit tests for !JavascriptFiles

These tests require Foswiki:Extensions.JSUnitContrib to run.

*[[%PUBURL%/%SYSTEMWEB%/JSUnitContrib/testRunner.html?testpage=%SCRIPTURL{"view"}%/%BASEWEB%/%TOPIC%][Run tests]]*
<a class="foswikiSubmit" href="%PUBURL%/%SYSTEMWEB%/JSUnitContrib/testRunner.html?testpage=%SCRIPTURL{"view"}%/%BASEWEB%/%TOPIC%">Run tests</a>

<script language="javascript" src="%PUBURL%/%SYSTEMWEB%/JSUnitContrib/app/jsUnitCore.js"></script>
<script language="javascript" src="%PUBURL%/%SYSTEMWEB%/JavascriptFiles/foswikilib.js"></script>
Expand Down Expand Up @@ -1042,20 +1042,26 @@ foswiki.Event.addLoadEvent("createTextNode");

foswiki.StringConstants.getInstance().init();

text = "�fg";
expected = "�fg";
text = "abc";
expected = "Abc";
result = foswiki.String.makeWikiWord(text);
assertEquals("makeWikiWord:", result, expected);

text = " word";
expected = "�Word";
text = "wiki word";
expected = "WikiWord";
result = foswiki.String.makeWikiWord(text);
assertEquals("makeWikiWord:", result, expected);

text = "�beral";
expected = "�beral";
text = "abc !@#$%&*()_+-={}[]:;\"'|\<,>.?/123";
expected = "Abc123";
result = foswiki.String.makeWikiWord(text);
assertEquals("makeWikiWord:", result, expected);

/*
TESTS (OR CODE) NOT FINISHED YET
NEEDS REAL LIFE CODE
*/

}
function testMakeWikiWord_UniCode_WithInvalidArgs() {
assertNull("An invalid argument should result in null:", foswiki.String.makeWikiWord(null));
Expand Down

0 comments on commit b068880

Please sign in to comment.