File: cstring.cpp

package info (click to toggle)
btllib 1.7.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,336 kB
  • sloc: cpp: 79,742; python: 941; sh: 302; makefile: 5
file content (23 lines) | stat: -rw-r--r-- 399 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "btllib/cstring.hpp"
#include "helpers.hpp"

#include <iostream>

int
main()
{
  btllib::CString cstring("ACTG");

  TEST_ASSERT_EQ(cstring[2], 'T');
  cstring[2] = 'C';
  TEST_ASSERT_EQ(cstring[2], 'C');

  cstring.erase(1, 2);
  TEST_ASSERT_EQ(std::string(cstring), "AG");

  cstring.erase();
  TEST_ASSERT_EQ(cstring.size(), 0);
  TEST_ASSERT_EQ(std::string(cstring), "");

  return 0;
}