-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.cpp
More file actions
34 lines (31 loc) · 738 Bytes
/
Copy pathtest.cpp
File metadata and controls
34 lines (31 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// test.cpp
// algorithms. stack and queue implementations. stack with get_min()
//
// Created by alifar on 11/20/17.
// Copyright © 2017 alifar. All rights reserved.
//
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "special_stack.hpp"
#include <iostream>
TEST_CASE("Special Stack Push and Min"){
StackWithMin stack;
stack.Push(5);
REQUIRE(stack.get_min() == 5);
stack.Push(10);
REQUIRE(stack.get_min() == 5);
stack.Push(3);
REQUIRE(stack.get_min() == 3);
}
TEST_CASE("Special Stack Pop and Min"){
StackWithMin stack;
stack.Push(5);
stack.Push(10);
stack.Push(3);
REQUIRE(stack.get_min() == 3);
stack.Pop();
REQUIRE(stack.get_min() == 5);
stack.Pop();
REQUIRE(stack.get_min() == 5);
}