mirror of
https://github.com/boostorg/json.git
synced 2026-01-26 18:42:16 +00:00
committed by
Vinnie Falco
parent
6057a9f760
commit
ed8f95e161
@@ -778,6 +778,41 @@ public:
|
||||
BOOST_TEST(! validate(js));
|
||||
}
|
||||
|
||||
void
|
||||
testIssue113()
|
||||
{
|
||||
string_view s =
|
||||
"\"\\r\\n section id='description'>\\r\\nAll mbers form the uncountable set "
|
||||
"\\u211D. Among its subsets, relatively simple are the convex sets, each expressed "
|
||||
"as a range between two real numbers <i>a</i> and <i>b</i> where <i>a</i> \\u2264 <i>"
|
||||
"b</i>. There are actually four cases for the meaning of \\\"between\\\", depending "
|
||||
"on open or closed boundary:\\r\\n\\r\\n<ul>\\r\\n <li>[<i>a</i>, <i>b</i>]: {<i>"
|
||||
"x</i> | <i>a</i> \\u2264 <i>x</i> and <i>x</i> \\u2264 <i>b</i> }</li>\\r\\n <li>"
|
||||
"(<i>a</i>, <i>b</i>): {<i>x</i> | <i>a</i> < <i>x</i> and <i>x</i> < <i>b</i> }"
|
||||
"</li>\\r\\n <li>[<i>a</i>, <i>b</i>): {<i>x</i> | <i>a</i> \\u2264 <i>x</i> and "
|
||||
"<i>x</i> < <i>b</i> }</li>\\r\\n <li>(<i>a</i>, <i>b</i>]: {<i>x</i> | <i>a</i> "
|
||||
"< <i>x</i> and <i>x</i> \\u2264 <i>b</i> }</li>\\r\\n</ul>\\r\\n\\r\\nNote that "
|
||||
"if <i>a</i> = <i>b</i>, of the four only [<i>a</i>, <i>a</i>] would be non-empty."
|
||||
"\\r\\n\\r\\n<strong>Task</strong>\\r\\n\\r\\n<ul>\\r\\n <li>Devise a way to "
|
||||
"represent any set of real numbers, for the definition of \\\"any\\\" in the "
|
||||
"implementation notes below.</li>\\r\\n <li>Provide methods for these common "
|
||||
"set operations (<i>x</i> is a real number; <i>A</i> and <i>B</i> are sets):</li>"
|
||||
"\\r\\n <ul>\\r\\n <li>\\r\\n <i>x</i> \\u2208 <i>A</i>: determine if <i>"
|
||||
"x</i> is an element of <i>A</i><br>\\r\\n example: 1 is in [1, 2), while 2, "
|
||||
"3, ... are not.\\r\\n </li>\\r\\n <li>\\r\\n <i>A</i> \\u222A <i>B</i>: "
|
||||
"union of <i>A</i> and <i>B</i>, i.e. {<i>x</i> | <i>x</i> \\u2208 <i>A</i> or <i>x"
|
||||
"</i> \\u2208 <i>B</i>}<br>\\r\\n example: [0, 2) \\u222A (1, 3) = [0, 3); "
|
||||
"[0, 1) \\u222A (2, 3] = well, [0, 1) \\u222A (2, 3]\\r\\n </li>\\r\\n <li>"
|
||||
"\\r\\n <i>A</i> \\u2229 <i>B</i>: intersection of <i>A</i> and <i>B</i>, i.e. "
|
||||
"{<i>x</i> | <i>x</i> \\u2208 <i>A</i> and <i>x</i> \\u2208 <i>B</i>}<br>\\r\\n "
|
||||
"example: [0, 2) \\u2229 (1, 3) = (1, 2); [0, 1) \\u2229 (2, 3] = empty set\\r\\n "
|
||||
"</li>\\r\\n <li>\\r\\n <i>A</i> - <i>B</i>: difference between <i>A</i> and "
|
||||
"<i>B</i>, also written as <i>A</i> \\\\ <i>B</i>, i.e. {<i>x</i> | <i>x</i> \\u2208 "
|
||||
"<i>A</i> and <i>x</i> \\u2209 <i>B</i>}<br>\\r\\n example: [0, 2) \\u2212 (1, "
|
||||
"3) = [0, 1]\\r\\n </li>\\r\\n </ul>\\r\\n</ul>\\r\\n</section>\\r\\n\"\n";
|
||||
good(s);
|
||||
}
|
||||
|
||||
void
|
||||
run()
|
||||
{
|
||||
@@ -792,6 +827,7 @@ public:
|
||||
testParseVectors();
|
||||
testIssue13();
|
||||
testIssue20();
|
||||
testIssue113();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user