source: dev/branches/egtra/ab5.0/abdev/ab-test/jenga.cpp@ 818

Last change on this file since 818 was 818, checked in by イグトランス (egtra), 14 years ago

Jenga/common/String.hに対するテストを追加

File size: 1.1 KB
Line 
1/**
2@file jenga.cpp
3
4@brief jengaプロジェクト内のコードに対するテスト。
5*/
6
7
8#include "stdafx.h"
9
10#include <locale>
11#include <jenga/include/jenga.h>
12
13using namespace Jenga::Common;
14
15/**
16@breif Jenga/Common/String.hの関数などに対するテスト。
17*/
18BOOST_AUTO_TEST_CASE( JengaCommonString )
19{
20 std::string s = "Dete koi dete koi ike no koi";
21 StringReplace(s, "koi", "ike");
22 BOOST_CHECK_EQUAL(s, "Dete ike dete ike ike no ike");
23 BOOST_CHECK_EQUAL(ToString(42), "42");
24 BOOST_CHECK_EQUAL(ToString(-7), "-7");
25 BOOST_CHECK_EQUAL(ToString(std::wstring(L"ABC123")), "ABC123");
26 BOOST_CHECK(ToWString(std::string("ABC123")) == L"ABC123");
27 BOOST_CHECK(IsIdentifierTopChar('a'));
28 BOOST_CHECK(IsIdentifierTopChar('z'));
29 BOOST_CHECK(IsIdentifierTopChar('A'));
30 BOOST_CHECK(IsIdentifierTopChar('Z'));
31 BOOST_CHECK(IsIdentifierTopChar('_'));
32 BOOST_CHECK(IsIdentifierChar('a'));
33 BOOST_CHECK(IsIdentifierChar('z'));
34 BOOST_CHECK(IsIdentifierChar('A'));
35 BOOST_CHECK(IsIdentifierChar('Z'));
36 BOOST_CHECK(IsIdentifierChar('_'));
37 BOOST_CHECK(IsIdentifierChar('0'));
38 BOOST_CHECK(IsIdentifierChar('9'));
39}
Note: See TracBrowser for help on using the repository browser.