mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Apply suggestions from code review
The code after this commit requires reformatting. Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
parent
8ca74d2cb0
commit
18203b200e
@ -5,12 +5,16 @@
|
|||||||
* the function longest_common_string_length computes the length
|
* the function longest_common_string_length computes the length
|
||||||
* of the longest common string which can be created of two input strings
|
* of the longest common string which can be created of two input strings
|
||||||
* by removing characters from them
|
* by removing characters from them
|
||||||
|
*
|
||||||
|
* @author [Nikhil Arora](https://github.com/nikhilarora068)
|
||||||
|
* @author [Piotr Idzik](https://github.com/vil02)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cassert> /// for assert
|
#include <cassert> /// for assert
|
||||||
#include <string> /// for std::string
|
#include <string> /// for std::string
|
||||||
#include <utility> /// for std::move
|
#include <utility> /// for std::move
|
||||||
#include <vector> /// for std::vector
|
#include <vector> /// for std::vector
|
||||||
|
#include <iostream> /// for IO operations
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief computes the length of the longest common string created from input
|
* @brief computes the length of the longest common string created from input
|
||||||
@ -128,12 +132,14 @@ void test_longest_common_string_length_for_reversed_inputs(
|
|||||||
/**
|
/**
|
||||||
* @brief runs all tests for longest_common_string_length funcion
|
* @brief runs all tests for longest_common_string_length funcion
|
||||||
*/
|
*/
|
||||||
void tests() {
|
static void tests() {
|
||||||
const auto test_cases = get_test_cases();
|
const auto test_cases = get_test_cases();
|
||||||
assert(test_cases.size() > 0);
|
assert(test_cases.size() > 0);
|
||||||
test_longest_common_string_length(test_cases);
|
test_longest_common_string_length(test_cases);
|
||||||
test_longest_common_string_length_is_symmetric(test_cases);
|
test_longest_common_string_length_is_symmetric(test_cases);
|
||||||
test_longest_common_string_length_for_reversed_inputs(test_cases);
|
test_longest_common_string_length_for_reversed_inputs(test_cases);
|
||||||
|
|
||||||
|
std::cout << "All tests have successfully passed!\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user