File: make-test-data

package info (click to toggle)
condor 8.6.8~dfsg.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 79,476 kB
  • sloc: cpp: 649,368; perl: 108,260; python: 22,654; ansic: 20,588; sh: 19,729; fortran: 3,340; yacc: 1,844; makefile: 1,213; xml: 1,003; sql: 767; java: 703; ruby: 512; awk: 505; lex: 248; f90: 64; csh: 24
file content (31 lines) | stat: -rwxr-xr-x 578 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
#! /usr/bin/perl -w
use strict;

my $records = 20;

my(@colors) = qw(red green);
my(@highlight) = qw(black white);
my(@shapes) = qw(cube sphere);
my(@sizes) = (1, 2);

print "[\n";
for(my $i = 0; $i < $records; $i++) {
	my $c = $colors[int rand @colors];
	my $c2 = $highlight[int rand @highlight];
	my $s = $shapes[int rand @shapes];
	my $si = $sizes[int rand @sizes];
	my $qty = 1+ int rand 5;
	my $comma = '';
	if(($i+1) < $records) { $comma = ','};
	print <<END;
{
	"color": "$c",
	"highlight": "$c2",
	"shape": "$s",
	"size": $si,
	"count": $qty
}$comma
END
}

print "]\n";