<commit_before>﻿module Paket.DowngradeIssue3103

open Paket
open NUnit.Framework
open FsUnit
open TestHelpers
open Paket.Domain

let graph = 
  OfSimpleGraph [
    "delphi-tf-latest-convert ","0.0.75",["delphi-TaxDoc", VersionRequirement(VersionRange.AtLeast "0",PreReleaseStatus.No)]
    "delphi-tf-latest-convert ","0.0.74",["delphi-TaxDoc", VersionRequirement(VersionRange.AtLeast "0",PreReleaseStatus.No)]
    "delphi-TaxDoc","192.168.127.12",[]
    "delphi-TaxDoc","192.168.3.11",[]
    "delphi-tf-latest-calc,","1.0.127",[]
  ]

let config = """
source "https://www.nuget.org/api/v2"

nuget delphi-tf-latest-convert
"""


[<Test>]
let ``should resolve config``() = 
    let cfg = DependenciesFile.FromSource(config)
    let resolved = ResolveWithGraph(cfg,noSha1, VersionsFromGraphAsSeq graph, PackageDetailsFromGraph graph).[Constants.MainDependencyGroup].ResolvedPackages.GetModelOrFail()
    getVersion resolved.[PackageName "delphi-tf-latest-convert"] |> shouldEqual "0.0.75"
<commit_msg>Complete dependency graph to reproduce Issue 3103<commit_after>﻿module Paket.DowngradeIssue3103

open Paket
open NUnit.Framework
open FsUnit
open TestHelpers
open Paket.Domain

let exactVersion s =
    let info = SemVer.Parse s |> VersionRange.Specific
    VersionRequirement(info, PreReleaseStatus.No)

let anyVersion = VersionRequirement(VersionRange.AtLeast "0",PreReleaseStatus.No)

let graph = 
  OfSimpleGraph [
    "delphi-tf-latest-convert ","0.0.75",[("delphi-TaxDoc", anyVersion); ("delphi-tf-latest-calc", anyVersion)]
    "delphi-tf-latest-convert ","0.0.74",[("delphi-TaxDoc", anyVersion); ("delphi-tf-latest-calc", anyVersion)]
    "delphi-TaxDoc","192.168.127.12",["dummy", (exactVersion "192.168.127.12")]
    "delphi-TaxDoc","192.168.3.11",["dummy", (exactVersion "192.168.3.11")]
    "delphi-tf-latest-calc","1.0.127",["delphi-CchData", (exactVersion "192.168.3.11")]
    "delphi-CchData","192.168.3.11",["dummy", (exactVersion "192.168.3.11")]
    "dummy","192.168.127.12",[]
    "dummy","192.168.3.11",[]
  ]

let config = """
source "https://www.nuget.org/api/v2"

nuget delphi-tf-latest-convert
"""


[<Test>]
let ``should resolve config``() = 
    let cfg = DependenciesFile.FromSource(config)
    let resolved = ResolveWithGraph(cfg,noSha1, VersionsFromGraphAsSeq graph, PackageDetailsFromGraph graph).[Constants.MainDependencyGroup].ResolvedPackages.GetModelOrFail()
    getVersion resolved.[PackageName "delphi-tf-latest-convert"] |> shouldEqual "0.0.75"

{'fraction_non_alphanumeric': 0.16780960064542155, 'fraction_numerical': 0.0645421540943929, 'mean_word_length': 5.108374384236453, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 11, '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': '5100687', 'n_tokens_mistral': 960, 'n_tokens_neox': 864, 'n_words': 137}