Skip to content
Snippets Groups Projects
Commit 97a99e41 authored by Grégory Mantelet's avatar Grégory Mantelet
Browse files

[ADQL] `FeatureSet.unsupportAll()` must un-support all supported features

instead of ONLY those listed in `availableFeatures`.
parent ade12662
No related branches found
No related tags found
No related merge requests found
......@@ -427,8 +427,8 @@ public class FeatureSet implements Iterable<LanguageFeature> {
* @see #getAvailableFeatures()
*/
public final void unsupportAll() {
// unsupport all available features:
for(LanguageFeature feature : availableFeatures)
// unsupport all features currently supported:
for(LanguageFeature feature : this)
unsupport(feature);
// also unsupport any UDF:
......
......@@ -215,11 +215,17 @@ public class TestFeatureSet {
public void testUnsupportAll() {
FeatureSet set = new FeatureSet(true);
/* here is a custom Language Feature (i.e. not part of the
* availableFeatures list): */
set.support(new LanguageFeature(LanguageFeature.TYPE_UDF, "foo(VARCHAR) -> BOOLEAN", true));
// unsupport all currently supported features:
set.unsupportAll();
for(LanguageFeature feat : FeatureSet.availableFeatures) {
assertNotNull(feat);
assertFalse(set.supportedFeatures.containsKey(feat.type));
}
// ensure the list of supported features is really empty:
assertEquals(0, set.supportedFeatures.size());
// ...and that no non-declared UDF is allowed:
assertFalse(set.isAnyUdfAllowed());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment