File: 10-optional-6.2.14.t

package info (click to toggle)
libcsaf-perl 0.26-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,280 kB
  • sloc: perl: 7,583; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 846 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!perl

use 5.010001;
use strict;
use warnings;
use Test::More;

use FindBin '$RealBin';
use lib "$RealBin/lib";

use Test::CSAF qw(base_csaf_security_advisory exec_validator_optional_test);
use CSAF::Validator::OptionalTests;

# 6.2.14 Use of Private Language

# For each element of type /$defs/language_t it MUST be tested that the language code does not contain subtags reserved for private use.

# The relevant paths for this test are:

#   /document/lang
#   /document/source_lang

# Fail test:
#  "document": {
#    // ...
#    "lang": "qtx",
#    // ...
#  }

#   The language code qtx is reserved for private use.
#   A tool MAY remove such subtag as a quick fix.

my $csaf = base_csaf_security_advisory();

$csaf->document->lang('qtx');
$csaf->document->source_lang('qtx');

exec_validator_optional_test($csaf, '6.2.14');

done_testing;