unbound-cli 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ const { test } = require('node:test');
4
+ const assert = require('node:assert');
5
+
6
+ const { assertAnyExclusive } = require('../src/commands/policy');
7
+
8
+ test('assertAnyExclusive: allows a single ANY condition', () => {
9
+ assert.doesNotThrow(() => assertAnyExclusive({ ANY: '*' }));
10
+ });
11
+
12
+ test('assertAnyExclusive: allows multiple non-ANY fields (AND)', () => {
13
+ assert.doesNotThrow(() => assertAnyExclusive({ path: '/etc/*', operation: 'write' }));
14
+ });
15
+
16
+ test('assertAnyExclusive: rejects ANY combined with another field', () => {
17
+ assert.throws(() => assertAnyExclusive({ ANY: '*', path: '/etc/*' }), /ANY.*cannot be combined/);
18
+ });
19
+
20
+ test('assertAnyExclusive: case-insensitive — rejects lowercase/mixed-case any with another field', () => {
21
+ assert.throws(() => assertAnyExclusive({ any: '*', path: '/etc/*' }), /ANY.*cannot be combined/);
22
+ assert.throws(() => assertAnyExclusive({ Any: '*', path: '/etc/*' }), /ANY.*cannot be combined/);
23
+ });
24
+
25
+ test('assertAnyExclusive: tolerates empty/undefined config', () => {
26
+ assert.doesNotThrow(() => assertAnyExclusive({}));
27
+ assert.doesNotThrow(() => assertAnyExclusive(undefined));
28
+ });