<commit_before>@TestOn('windows')

import 'package:test/test.dart';
import 'package:win32/win32.dart';

import '../tool/winmd/enums.dart';
import '../tool/winmd/md_store.dart';

void main() {
  if (isWindowsRuntimeAvailable()) {
    test('List all tokens in a file', () {
      final mdScope =
          WinmdStore.getScopeForType('Windows.Globalization.Calendar');

      expect(
          mdScope.typeDefs.length, equals(104)); // at least, on Windows 10 2004
    });

    test('Find a specific WinMD token', () {
      final mdScope =
          WinmdStore.getScopeForType('Windows.Globalization.ICalendarFactory');

      final type = mdScope.findTypeDef('Windows.Globalization.Calendar');
      expect(type.token, equals(0x02000003));
    });<commit_msg>More tolerance in WinMD test<commit_after>@TestOn('windows')

import 'package:test/test.dart';
import 'package:win32/win32.dart';

import '../tool/winmd/enums.dart';
import '../tool/winmd/md_store.dart';

void main() {
  if (isWindowsRuntimeAvailable()) {
    test('List all tokens in a file', () {
      final mdScope =
          WinmdStore.getScopeForType('Windows.Globalization.Calendar');

      // This is 99 on Windows Server 2019, 104 on Windows 10 2004. The exact
      // number is less critical than that this returns a sane result.
      expect(mdScope.typeDefs.length, greaterThan(50));
    });

    test('Find a specific WinMD token', () {
      final mdScope =
          WinmdStore.getScopeForType('Windows.Globalization.ICalendarFactory');

      final type = mdScope.findTypeDef('Windows.Globalization.Calendar');
      expect(type.token, equals(0x02000003));
    });
{'fraction_non_alphanumeric': 0.13772090188909203, 'fraction_numerical': 0.031687995124923825, 'mean_word_length': 3.4619565217391304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6303990', 'n_tokens_mistral': 538, 'n_tokens_neox': 490, 'n_words': 110}