|
| 1 | +/*! |
| 2 | +This file is part of CycloneDX JavaScript Library. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +
|
| 16 | +SPDX-License-Identifier: Apache-2.0 |
| 17 | +Copyright (c) OWASP Foundation. All Rights Reserved. |
| 18 | +*/ |
1 | 19 |
|
2 | 20 | const assert = require('assert')
|
3 | 21 | const { suite, test } = require('mocha')
|
4 | 22 |
|
5 |
| -const { Utils : { |
6 |
| - BomUtility |
7 |
| -}} = require('../../'); |
| 23 | +const { |
| 24 | + Utils: { |
| 25 | + BomUtility |
| 26 | + } |
| 27 | +} = require('../../') |
8 | 28 |
|
9 | 29 | suite('Utils.BomUtility', () => {
|
10 | 30 | suite('randomSerialNumber()', () => {
|
11 | 31 | test('has correct format according to XSD', () => {
|
12 |
| - const value = BomUtility.randomSerialNumber(); |
13 |
| - assert.match(value, /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$/); |
14 |
| - }); |
| 32 | + const value = BomUtility.randomSerialNumber() |
| 33 | + assert.match(value, /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$/) |
| 34 | + }) |
15 | 35 | test('has correct format according to JSON schema', () => {
|
16 |
| - const value = BomUtility.randomSerialNumber(); |
17 |
| - assert.match(value, /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/); |
| 36 | + const value = BomUtility.randomSerialNumber() |
| 37 | + assert.match(value, /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/) |
18 | 38 | })
|
19 | 39 | })
|
20 | 40 | })
|
0 commit comments