Skip to content

Commit 4f77045

Browse files
committed
fixup formatting
1 parent 89b8444 commit 4f77045

File tree

3 files changed

+41
-12
lines changed

3 files changed

+41
-12
lines changed

source/mir/format.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ ref W print(C = char, W, T)(scope return ref W w, ref const T c)
994994
/// ditto
995995
// FUTURE: remove it
996996
pragma(inline, false)
997-
ref W print(C = char, W, T)(scope return ref W w, scope const T c)
997+
ref W print(C = char, W, T)(scope return ref W w, const T c)
998998
if (isSomeChar!C && is(T == struct) || is(T == union))
999999
{
10001000
return print!(C, W, T)(w, c);

source/mir/series.d

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,21 +1316,16 @@ struct mir_series(IndexIterator_, Iterator_, size_t N_ = 1, SliceKind kind_ = Co
13161316
{
13171317
import mir.format: print;
13181318
auto ls = lightScope;
1319-
print(w, "{ index: ", ls.index, ", data: ", ls.data, " }");
1319+
print(w, "{ index: ");
1320+
print(w, ls.index);
1321+
print(w, ", data: ");
1322+
print(w, ls.data);
1323+
print(w, " }");
13201324
}
13211325

1322-
version(mir_test)
1323-
///
1324-
unittest
1325-
{
1326-
import mir.series: series, sort;
1327-
auto s = ["b", "a"].series([9, 8]).sort;
1328-
1329-
import mir.format : text;
1330-
assert(s.text == `{ index: [a, b], data: [8, 9] }`);
1331-
}
13321326
}
13331327

1328+
13341329
/// ditto
13351330
alias Series = mir_series;
13361331

@@ -1441,6 +1436,17 @@ alias Series = mir_series;
14411436
}
14421437
}
14431438

1439+
version(mir_test)
1440+
///
1441+
@safe unittest
1442+
{
1443+
import mir.series: series, sort;
1444+
auto s = ["b", "a"].series([9, 8]).sort;
1445+
1446+
import mir.format : text;
1447+
assert(s.text == `{ index: [a, b], data: [8, 9] }`);
1448+
}
1449+
14441450
/++
14451451
Convenient function for $(LREF Series) construction.
14461452
See_also: $(LREF assocArray)

source/mir/stdio.d

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,26 @@ private static immutable writeException = new FileException("Error on file write
316316
private static immutable flushException = new FileException("Error on file flush");
317317
private static immutable writeError = new FileError("Error on file write");
318318
private static immutable flushError = new FileError("Error on file flush");
319+
320+
@safe unittest
321+
{
322+
static struct ParameterSpec
323+
{
324+
string name;
325+
string type;
326+
string default_;
327+
}
328+
329+
static struct FunctionOverloadSpec
330+
{
331+
ParameterSpec[] parameters;
332+
string doc;
333+
string test;
334+
size_t minArgs;
335+
}
336+
337+
import mir.algebraic;
338+
import mir.stdio;
339+
if (false)
340+
Algebraic!(FunctionOverloadSpec, ParameterSpec).init.writeln; // error
341+
}

0 commit comments

Comments
 (0)