CARVIEW |
Select Language
HTTP/2 302
date: Thu, 31 Jul 2025 11:25:08 GMT
content-type: text/html; charset=utf-8
content-length: 0
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
access-control-allow-origin:
location: https://raw.githubusercontent.com/intel/rohd-vf/main/test/tracker_test.dart
cache-control: no-cache
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
x-github-request-id: D21E:23875B:907808:ACD924:688B5293
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"7c68f1a84290c4956bb09aa90e57e351618021f1c6baaafbe8fae22b96dca013"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: EC32:185098:DABFE:21C919:688B5293
content-encoding: gzip
accept-ranges: bytes
date: Thu, 31 Jul 2025 11:25:08 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210052-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753961108.155866,VS0,VE260
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 3eaff959cda2f27f07602069b3abbee8a1601468
expires: Thu, 31 Jul 2025 11:30:08 GMT
source-age: 0
content-length: 1214
// Copyright (C) 2021-2023 Intel Corporation
// SPDX-License-Identifier: BSD-3-Clause
//
// tracker_test.dart
// Test the tracker
//
// 2021 December 6
// Author: Max Korbel
// ignore_for_file: lines_longer_than_80_chars, avoid_dynamic_calls
import 'dart:convert';
import 'dart:io';
import 'package:rohd/rohd.dart';
import 'package:rohd_vf/rohd_vf.dart';
import 'package:test/test.dart';
class FruitEvent implements Trackable {
final LogicValue apple;
final String banana;
final int carrot;
final String? pear;
FruitEvent(this.apple, this.banana, this.carrot, this.pear);
@override
String? trackerString(TrackerField field) {
switch (field.title) {
case 'Apple':
return apple.toString();
case 'Banana':
return banana;
case 'Carrot':
return carrot.toString();
case 'Durian':
return (carrot * 2).toRadixString(16);
case 'Pear':
return pear;
}
return null;
}
}
void main() {
test('tracker test', () async {
final tracker = Tracker(
'testTracker',
[
const TrackerField('Apple', columnWidth: 10),
const TrackerField('Banana', columnWidth: 5),
const TrackerField('Carrot', columnWidth: 12, justify: Justify.center),
const TrackerField('Durian', columnWidth: 12, mapOnly: true),
const TrackerField('Pear', columnWidth: 12)
],
)
..record(
FruitEvent(LogicValue.ofString('1x0'), 'banana', 25, 'green pear'),
defaults: {'Pear': 'red pear'})
..record(
FruitEvent(
LogicValue.ofString('1x01111000011010101'), 'aaa', 5, null),
defaults: {'Pear': 'red pear'});
// Expect JSON log to look like:
// {"records":[
// {"Apple": "3'b1x0", "Banana": "banana", "Carrot": "25", "Durian": "32", "Pear": "green pear"}
// , {"Apple": "19'b1x01111000011010101", "Banana": "aaa", "Carrot": "4", "Durian": "8", "Pear": "red pear"}
// ]}
await tracker.terminate();
final jsonOutput =
json.decode(File(tracker.jsonFileName).readAsStringSync());
expect(jsonOutput['records'].length, equals(2));
expect(jsonOutput['records'][0]['Banana'], equals('banana'));
expect(jsonOutput['records'][1]['Durian'], equals('a'));
expect(jsonOutput['records'][0]['Pear'], equals('green pear'));
expect(jsonOutput['records'][1]['Pear'], equals('red pear'));
// Expect table log to look like:
// ------------------------------------------------------
// | A | B | C | P |
// | P | A | A | E |
// | P | N | R | A |
// | L | A | R | R |
// | E | N | O | |
// | | A | T | |
// ------------------------------------------------------
// | 3'b1x0 | bana* | 25 | green pear | {Apple: 3'b1x0, Banana: banana, Carrot: 25, Durian: 32, Pear: green pear}
// | 19'b1x011* | aaa | 5 | red pear | {Apple: 19'b1x01111000011010101, Banana: aaa, Carrot: 5, Durian: a, Pear: red pear}
final logOutput = File(tracker.tableFileName).readAsStringSync();
expect(logOutput.contains('bana*'), equals(true));
expect(logOutput.split('\n')[1].split('|').length, equals(6));
File(tracker.jsonFileName).deleteSync();
File(tracker.tableFileName).deleteSync();
});
}