blob: 795c5aff6502e96f4dc566727f758fd0ad67a67f (
plain)
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
|
// =============================================================================
// Copyright (C) 2011 - INRIA - Michael Baudin
// =============================================================================
// See all the available fields
allvalues = csvDefault();
expected = [
"separator" ","
"decimal" "."
"conversion" "double"
"precision" "%.17lg"
"regexp" ""
];
if getos() == "Windows" then
expected = [expected; "eol" "windows"];
else
expected = [expected; "eol" "linux"];
end
expected = [expected; "encoding" "utf-8"];
expected = [expected; "blank" "on"];
assert_checkequal ( allvalues , expected );
// Get the value of the "precision" field
value = csvDefault("precision");
assert_checkequal ( value , "%.17lg" );
// Set the value of the "precision" field
bRes = csvDefault("precision","%.17e");
assert_checkequal ( bRes , %t );
// Set the value of the "precision" field to
// an impossible value
bRes = csvDefault("precision","Ouch!");
assert_checkequal ( bRes , %f );
// =============================================================================
|