<commit_before>import 'package:test/test.dart';
import 'package:win32/win32.dart';
import 'package:win32_registry/win32_registry.dart';

void main() {
  test('Basic test', () {
    // In any working Windows configuration, this key should have a sizable
    // number of values.
    final key = Registry.openPath(RegistryHive.localMachine,
        path: r'Software\Microsoft\Windows NT\CurrentVersion');

    expect(key.values.length, greaterThan(0));
    key.close();
  });

  test('Test key types 1', () {
    // Uses key types that should exist in any standard Windows configuration.
    final env =
        Registry.openPath(RegistryHive.currentUser, path: 'Environment');
    expect(
        env.getValue('Path')?.type, equals(RegistryValueType.unexpandedString));
    expect(env.getValue('Path')?.type.win32Value, equals(REG_EXPAND_SZ));
    expect(env.getValue('Path')?.type.win32Type, equals('REG_EXPAND_SZ'));

    expect(env.getValue('PROMPT')?.type, equals(RegistryValueType.string));
    expect(env.getValue('PROMPT')?.type.win32Value, equals(REG_SZ));
    expect(env.getValue('PROMPT')?.type.win32Type, equals('REG_SZ'));
    env.close();
  });

  test('Test key types 2', () {
    // Uses key types that should exist in any standard Windows configuration.
    final console =
        Registry.openPath(RegistryHive.currentUser, path: 'Console');
    expect(
        console.getValue('FullScreen')?.type, equals(RegistryValueType.int32));
    expect(console.getValue('FullScreen')?.type.win32Value, equals(REG_DWORD));
    expect(console.getValue('FullScreen')?.type.win32Type, equals('REG_DWORD'));
    console.close();
  });

  test('Test key types 3', () {
    // Uses key types that should exist in any standard Windows configuration.
    final windowMetrics = Registry.openPath(RegistryHive.currentUser,
        path: r'Control Panel\Desktop\WindowMetrics');
    expect(windowMetrics.getValue('IconFont')?.type,
        equals(RegistryValueType.binary));
    expect(windowMetrics.getValue('IconFont')?.type.win32Value,
        equals(REG_BINARY));
    expect(windowMetrics.getValue('IconFont')?.type.win32Type,
        equals('REG_BINARY'));
    windowMetrics.close();
  });

  test('Test key types 4', () {
    // Uses key types that should exist in any standard Windows configuration.
    final currentVersion = Registry.openPath(RegistryHive.localMachine,
        path: r'SOFTWARE\Microsoft\Windows NT\CurrentVersion');
    expect(currentVersion.getValue('InstallTime')?.type,
        equals(RegistryValueType.int64));
    currentVersion.close();
  });

  test('Test missing key', () {
    // Uses key that should be missing.
    expect(
        () => Registry.openPath(RegistryHive.localMachine,
            path: r'SOFTWARE\Dart\Missing\Key'),<commit_msg>Fix test to work on CI/CD<commit_after>import 'package:test/test.dart';
import 'package:win32/win32.dart';
import 'package:win32_registry/win32_registry.dart';

void main() {
  test('Basic test', () {
    // In any working Windows configuration, this key should have a sizable
    // number of values.
    final key = Registry.openPath(RegistryHive.localMachine,
        path: r'Software\Microsoft\Windows NT\CurrentVersion');

    expect(key.values.length, greaterThan(0));
    key.close();
  });

  test('Test key types 1', () {
    // Uses key types that should exist in any standard Windows configuration.
    final env =
        Registry.openPath(RegistryHive.currentUser, path: 'Environment');
    expect(
        env.getValue('Path')?.type, equals(RegistryValueType.unexpandedString));
    expect(env.getValue('Path')?.type.win32Value, equals(REG_EXPAND_SZ));
    expect(env.getValue('Path')?.type.win32Type, equals('REG_EXPAND_SZ'));
    env.close();
  });

  test('Test key types 2', () {
    // Uses key types that should exist in any standard Windows configuration.
    final console =
        Registry.openPath(RegistryHive.currentUser, path: 'Console');
    expect(
        console.getValue('FullScreen')?.type, equals(RegistryValueType.int32));
    expect(console.getValue('FullScreen')?.type.win32Value, equals(REG_DWORD));
    expect(console.getValue('FullScreen')?.type.win32Type, equals('REG_DWORD'));
    console.close();
  });

  test('Test key types 3', () {
    // Uses key types that should exist in any standard Windows configuration.
    final windowMetrics = Registry.openPath(RegistryHive.currentUser,
        path: r'Control Panel\Desktop\WindowMetrics');
    expect(windowMetrics.getValue('IconFont')?.type,
        equals(RegistryValueType.binary));
    expect(windowMetrics.getValue('IconFont')?.type.win32Value,
        equals(REG_BINARY));
    expect(windowMetrics.getValue('IconFont')?.type.win32Type,
        equals('REG_BINARY'));
    windowMetrics.close();
  });

  test('Test key types 4', () {
    // Uses key types that should exist in any standard Windows configuration.
    final ntCurrentVersion = Registry.openPath(RegistryHive.localMachine,
        path: r'SOFTWARE\Microsoft\Windows NT\CurrentVersion');
    expect(ntCurrentVersion.getValue('InstallTime')?.type,
        equals(RegistryValueType.int64));
    expect(ntCurrentVersion.getValue('InstallTime')?.type.win32Value,
        equals(REG_QWORD));
    expect(ntCurrentVersion.getValue('InstallTime')?.type.win32Type,
        equals('REG_QWORD'));
    ntCurrentVersion.close();
  });

  test('Test key types 5', () {
    // Uses key types that should exist in any standard Windows configuration.
    final currentVersion = Registry.openPath(RegistryHive.localMachine,
        path: r'SOFTWARE\Microsoft\Windows\CurrentVersion');
    expect(currentVersion.getValue('ProgramFilesDir')?.type,
        equals(RegistryValueType.string));
    expect(currentVersion.getValue('ProgramFilesDir')?.type.win32Value,
        equals(REG_SZ));
    expect(currentVersion.getValue('ProgramFilesDir')?.type.win32Type,
        equals('REG_SZ'));
    currentVersion.close();
  });

  test('Test missing key', () {
    // Uses key that should be missing.
    expect(
        () => Registry.openPath(RegistryHive.localMachine,
            path: r'SOFTWARE\Dart\Missing\Key'),
{'fraction_non_alphanumeric': 0.13880280541510356, 'fraction_numerical': 0.011580492578698419, 'mean_word_length': 3.993485342019544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3925698', 'n_tokens_mistral': 1824, 'n_tokens_neox': 1739, 'n_words': 349}