File: cstring.cpp

package info (click to toggle)
btllib 1.4.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,340 kB
  • sloc: cpp: 61,642; sh: 301; python: 222; makefile: 6
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;
}