Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #130

Merged
merged 1 commit into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions building-h2o/test.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@

#include <gtest/gtest.h>
#include <algorithm>
#include <functional>
#include <future>
#include <gtest/gtest.h>
#include <iostream>
#include <mutex>
#include <queue>
#include <sstream>
#include <thread>
#include<sstream>
#include <algorithm>
import leetcode_test.building_h2o.H2O;
using namespace std;
using leetcode_test::building_h2o::H2O;
TEST(building_h2o,main) {
TEST(building_h2o, main)
{
stringstream output;
mutex lock;
H2O h2o {};

auto t1 = thread([&]() {
h2o.hydrogen([&]() {
lock_guard<mutex> gaurd{lock};
lock_guard<mutex> gaurd { lock };
cout << "H" << endl;
output << "H";
});
Expand Down Expand Up @@ -76,7 +77,8 @@ TEST(building_h2o,main) {
ASSERT_EQ(2, count(two.begin(), two.end(), 'H'));
}

int main(int argc, char **argv) {
int main(int argc, char** argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "https://deno.land/std@0.188.0/path/mod.ts";
import AsyncLimiterClass, {
AsyncCurrentLimiter,
} from "https://esm.sh/@masx200/async-task-current-limiter@2.1.0/";
import {join, resolve}from "https://deno.land/std@0.188.0/path/mod.ts";
import { join, resolve } from "https://deno.land/std@0.188.0/path/mod.ts";

import { BinaryHeap } from "https://deno.land/std@0.188.0/collections/binary_heap.ts";
import { Deque } from "https://esm.sh/@datastructures-js/deque@1.0.4/";
Expand Down
17 changes: 10 additions & 7 deletions split-a-circular-linked-list/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,31 @@ using namespace leetcode_test::split_a_circular_linked_list;
using namespace std;
using std::vector;
template <class T>
concept sizable = requires(T& t) {
concept sizable = requires(T& t)
{
{
t.size()
} -> std::same_as<size_t>;
} -> std::same_as<size_t>;
};
template <class T>
concept iterable = requires(T& t) {
concept iterable = requires(T& t)
{
++t.begin();
{
t.begin() != t.end()

} -> std::same_as<bool>;
} -> std::same_as<bool>;
};

template <class T, typename Y>
concept equalable = requires(T& t, Y& y, size_t i) {
concept equalable = requires(T& t, Y& y, size_t i)
{
{
*t.begin() == *y.begin()
} -> std::same_as<bool>;
} -> std::same_as<bool>;
};
template <typename T, typename Y>
requires sizable<T> and sizable<Y> and equalable<T, Y> and iterable<T> and iterable<Y>
requires sizable<T> and sizable<Y> and equalable<T, Y> and iterable<T> and iterable<Y>
auto assertContentEquals(T& left, Y& right)
{

Expand Down
17 changes: 10 additions & 7 deletions web-crawler-multithreaded/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,30 @@ import leetcode_test.web_crawler_multithreaded.Solution;
using namespace std;
using namespace leetcode_test::web_crawler_multithreaded;
template <class T>
concept sizable = requires(T& t) {
concept sizable = requires(T& t)
{
{
t.size()
} -> std::same_as<size_t>;
} -> std::same_as<size_t>;
};
template <class T>
concept iterable = requires(T& t) {
concept iterable = requires(T& t)
{
++t.begin();
{
t.begin() != t.end()
} -> std::same_as<bool>;
} -> std::same_as<bool>;
};

template <class T, typename Y>
concept equalable = requires(T& t, Y& y, size_t i) {
concept equalable = requires(T& t, Y& y, size_t i)
{
{
*t.begin() == *y.begin()
} -> std::same_as<bool>;
} -> std::same_as<bool>;
};
template <typename T, typename Y>
requires sizable<T> and sizable<Y> and equalable<T, Y> and iterable<T> and iterable<Y>
requires sizable<T> and sizable<Y> and equalable<T, Y> and iterable<T> and iterable<Y>
auto assertContentEquals(const T& left, const Y& right)
{

Expand Down