~ubuntu-branches/ubuntu/wily/afnix/wily

« back to all changes in this revision

Viewing changes to src/lib/eng/tst/t_lexical.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2011-03-16 21:31:18 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110316213118-gk4k3ez3e5d2huna
Tags: 2.0.0-1
* QA upload.
* New upstream release
* Debian source format is 3.0 (quilt)
* Fix debhelper-but-no-misc-depends
* Fix ancient-standards-version
* Fix package-contains-linda-override
* debhelper compatibility is 7
* Fix dh-clean-k-is-deprecated

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
// - the copyright holder be liable for any  direct, indirect, incidental or -
12
12
// - special damages arising in any way out of the use of this software.     -
13
13
// ---------------------------------------------------------------------------
14
 
// - copyright (c) 1999-2007 amaury darsch                                   -
 
14
// - copyright (c) 1999-2011 amaury darsch                                   -
15
15
// ---------------------------------------------------------------------------
16
16
 
 
17
#include "Unicode.hpp"
17
18
#include "Lexical.hpp"
18
19
 
19
20
int main (int, char**) {
28
29
  if (lex.tostring  () != "hello") return 1;
29
30
  if (lex.getlnum   () != 0)       return 1;
30
31
 
 
32
  // create a unicode lexical
 
33
  const char*   cs = "noe\314\210l";
 
34
  const t_quad* fs = Unicode::decode (Encoding::UTF8, cs);
 
35
  Lexical lux (fs);
 
36
  
 
37
  // check for members
 
38
  if (lux.toliteral () != fs) return 1;
 
39
  if (lux.tostring  () != fs) return 1;
 
40
  if (lux.getlnum   () != 0)  return 1;
 
41
  // cleanup
 
42
  delete [] fs;
 
43
 
31
44
  // success
32
45
  return 0;
33
46
}