Skip to content

Commit 0346358

Browse files
authored
Merge pull request #2772 from PsiACE/infallible-tests
[test] apply the new test style to common-infallible
2 parents f451771 + 8512638 commit 0346358

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

common/infallible/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ license = "Apache-2.0"
66
publish = false
77
edition = "2021"
88

9+
[lib]
10+
doctest = false
11+
test = false
12+
913
[dependencies] # In alphabetical order
1014
# Workspace dependencies
1115

common/infallible/src/lib.rs

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#[cfg(test)]
16-
mod mutex_test;
17-
#[cfg(test)]
18-
mod rwlock_test;
19-
2015
mod exit_guard;
2116
mod mutex;
2217
mod rwlock;

common/infallible/tests/it/main.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2020 Datafuse Labs.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
mod mutex;
16+
mod rwlock;

common/infallible/src/mutex_test.rs renamed to common/infallible/tests/it/mutex.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn test_mutex() {
1717
use std::sync::Arc;
1818
use std::thread;
1919

20-
use crate::Mutex;
20+
use common_infallible::Mutex;
2121
let a = 7u8;
2222
let mutex = Arc::new(Mutex::new(a));
2323
let mutex2 = mutex.clone();

common/infallible/src/rwlock_test.rs renamed to common/infallible/tests/it/rwlock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn test_rwlock() {
1717
use std::sync::Arc;
1818
use std::thread;
1919

20-
use crate::RwLock;
20+
use common_infallible::RwLock;
2121

2222
let a = 7u8;
2323
let rwlock = Arc::new(RwLock::new(a));

0 commit comments

Comments
 (0)