Skip to content

Commit 5693724

Browse files
Updates to the conformance tests for integer values in %e and %f format directives (#495)
Updates to the conformance tests to support uint and int values in %e and %f format directives
1 parent 140f131 commit 5693724

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/simple/testdata/string_ext.textproto

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,13 +538,41 @@ section: {
538538
string_value: '2.718280',
539539
}
540540
}
541+
test: {
542+
name: "default precision for fixed-point clause with int"
543+
expr: '"%f".format([2])'
544+
value: {
545+
string_value: '2.000000',
546+
}
547+
}
548+
test: {
549+
name: "default precision for fixed-point clause with uint"
550+
expr: '"%f".format([3u])'
551+
value: {
552+
string_value: '3.000000',
553+
}
554+
}
541555
test: {
542556
name: "default precision for scientific notation"
543557
expr: '"%e".format([2.71828])'
544558
value: {
545559
string_value: '2.718280e+00',
546560
}
547561
}
562+
test: {
563+
name: "default precision for scientific notation with int"
564+
expr: '"%e".format([2])'
565+
value: {
566+
string_value: '2.000000e+00',
567+
}
568+
}
569+
test: {
570+
name: "default precision for scientific notation with uint"
571+
expr: '"%e".format([3u])'
572+
value: {
573+
string_value: '3.000000e+00',
574+
}
575+
}
548576
test: {
549577
name: "NaN support for scientific notation"
550578
expr: '"%e".format([double("NaN")])'

0 commit comments

Comments
 (0)