Skip to content

Commit 313abc3

Browse files
committed
lazycsv: Support no_std tests
1 parent 8a25421 commit 313abc3

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

crates/lazycsv/tests/main.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use lazycsv::Csv;
2-
#[cfg(feature = "alloc")]
3-
use lazycsv::{Cell, CsvIterItem};
1+
use lazycsv::{Cell, Csv, CsvIterItem};
42

53
macro_rules! assert_csv {
64
($csv:expr, Cell($buf:expr)) => {
@@ -61,7 +59,6 @@ fn basic() {
6159
assert_csv!(csv, EOF);
6260
}
6361

64-
#[cfg(feature = "alloc")]
6562
#[test]
6663
fn no_trailing_newline() {
6764
let mut csv = Csv::new(b"a,b,c\n1,2,3\n4,5,6");
@@ -109,7 +106,6 @@ fn position() {
109106
assert_csv!(csv, position == data.len()); // Position at the end
110107
}
111108

112-
#[cfg(feature = "alloc")]
113109
#[test]
114110
fn into_rows() {
115111
let mut iter = Csv::new(b"a,b,c\n1,2,3\n4,5,6\n").into_rows();
@@ -132,7 +128,6 @@ fn into_rows() {
132128
assert!(iter.next().is_none());
133129
}
134130

135-
#[cfg(feature = "alloc")]
136131
#[test]
137132
fn into_rows_no_trailing_newline() {
138133
let mut iter = Csv::new(b"a,b,c\n1,2,3\n4,5,6").into_rows();
@@ -155,7 +150,6 @@ fn into_rows_no_trailing_newline() {
155150
assert!(iter.next().is_none());
156151
}
157152

158-
#[cfg(feature = "alloc")]
159153
#[test]
160154
fn into_rows_malformed() {
161155
let mut iter = Csv::new(b"a,b,c\n1,2").into_rows();
@@ -168,7 +162,6 @@ fn into_rows_malformed() {
168162
assert!(iter.next().unwrap().is_err());
169163
}
170164

171-
#[cfg(feature = "alloc")]
172165
#[test]
173166
fn into_rows_with_range() {
174167
let mut iter = Csv::new(b"a,b,c\n1,2,3\n4,5,6\n").into_rows_with_range();
@@ -194,7 +187,6 @@ fn into_rows_with_range() {
194187
assert!(iter.next().is_none());
195188
}
196189

197-
#[cfg(feature = "alloc")]
198190
#[test]
199191
fn into_rows_with_range_no_trailing_newline() {
200192
let mut iter = Csv::new(b"a,b,c\n1,2,3\n4,5,6").into_rows_with_range();

0 commit comments

Comments
 (0)