<commit_before>﻿// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using Microsoft.CodeAnalysis.ExpressionEvaluator;
using Microsoft.VisualStudio.Debugger.Clr;
using Microsoft.VisualStudio.Debugger.Evaluation;
using System;
using System.Diagnostics;
using Xunit;
using Type = Microsoft.VisualStudio.Debugger.Metadata.Type;

namespace Microsoft.CodeAnalysis.CSharp.UnitTests
{
    public class FunctionPointerTests : CSharpResultProviderTestBase
    {
        [Fact]
        public void Root()
        {
            const int ptr = 0x1234;
            var value = CreateDkmClrValue(ptr, type: new DkmClrType(FunctionPointerType.Instance));
            var evalResult = FormatResult("pfn", value);
            Verify(evalResult,
                EvalResult("pfn", PointerToString(new IntPtr(ptr)), "System.Object*", "pfn", DkmEvaluationResultFlags.None, DkmEvaluationResultCategory.Other));
        }

        [Fact]
        public void Member()
        {
            var source =
@"class C<commit_msg>Disable tests that are blocking all PRs<commit_after>﻿// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using Microsoft.CodeAnalysis.ExpressionEvaluator;
using Microsoft.VisualStudio.Debugger.Clr;
using Microsoft.VisualStudio.Debugger.Evaluation;
using System;
using System.Diagnostics;
using Xunit;
using Type = Microsoft.VisualStudio.Debugger.Metadata.Type;

namespace Microsoft.CodeAnalysis.CSharp.UnitTests
{
    public class FunctionPointerTests : CSharpResultProviderTestBase
    {
        [Fact(Skip = "Tests are failing in Jenkins queues")]
        public void Root()
        {
            const int ptr = 0x1234;
            var value = CreateDkmClrValue(ptr, type: new DkmClrType(FunctionPointerType.Instance));
            var evalResult = FormatResult("pfn", value);
            Verify(evalResult,
                EvalResult("pfn", PointerToString(new IntPtr(ptr)), "System.Object*", "pfn", DkmEvaluationResultFlags.None, DkmEvaluationResultCategory.Other));
        }

        [Fact(Skip = "Tests are failing in Jenkins queues")]
        public void Member()
        {
            var source =
@"class C
{'fraction_non_alphanumeric': 0.08896492728828058, 'fraction_numerical': 0.005988023952095809, 'mean_word_length': 3.291743119266055, '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': '4046911', 'n_tokens_mistral': 632, 'n_tokens_neox': 615, 'n_words': 173}