mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
.autotest
git-svn-id: svn://ultimatepp.org/upp/trunk@7255 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
09eeb158b0
commit
1666fa0e0d
3 changed files with 18 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ uses
|
|||
Skylark;
|
||||
|
||||
file
|
||||
test2.witz,
|
||||
index.witz,
|
||||
etalon,
|
||||
main.cpp;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,14 @@ struct MyApp : SkylarkApp {
|
|||
}
|
||||
};
|
||||
|
||||
Value WitzUrlEncode(const Vector<Value>& arg, const Renderer *) {
|
||||
return arg.GetCount() == 1 && IsString(arg[0]) ? UrlEncode(arg[0]) : String();
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
Compiler::Register("url_encode", WitzUrlEncode);
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
StdLogSetup(LOG_FILE|LOG_COUT);
|
||||
|
|
@ -61,5 +69,13 @@ CONSOLE_APP_MAIN
|
|||
LOG("------------");
|
||||
// SaveFile(GetDataFile("etalon"), result);
|
||||
ASSERT(result == LoadFile(GetDataFile("etalon")));
|
||||
|
||||
m.Add("name", "What is that?");
|
||||
http("res", m);
|
||||
|
||||
result = http.RenderString("Witz/test2.witz");
|
||||
ASSERT(result == "What+is+that%3F\r\n");
|
||||
LOG(result);
|
||||
|
||||
LOG("========== OK");
|
||||
}
|
||||
|
|
|
|||
1
autotest/Witz/test2.witz
Normal file
1
autotest/Witz/test2.witz
Normal file
|
|
@ -0,0 +1 @@
|
|||
$url_encode(res.name)
|
||||
Loading…
Add table
Add a link
Reference in a new issue