From 3a36b627198b2d5e889da907f608565baff20e96 Mon Sep 17 00:00:00 2001 From: Smit Patel Date: Fri, 13 Sep 2019 16:06:14 -0700 Subject: [PATCH] Only compare product version excluding pre-release part --- test/EFCore.Tests/ModelSourceTest.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/EFCore.Tests/ModelSourceTest.cs b/test/EFCore.Tests/ModelSourceTest.cs index 802ddc69ddc..1f800722fc5 100644 --- a/test/EFCore.Tests/ModelSourceTest.cs +++ b/test/EFCore.Tests/ModelSourceTest.cs @@ -146,6 +146,12 @@ public void Stores_model_version_information_as_annotation_on_model() var packageVersion = typeof(Context1).Assembly.GetCustomAttributes() .Single(m => m.Key == "PackageVersion").Value; + var prereleaseIndex = packageVersion.IndexOf("-", StringComparison.Ordinal); + if (prereleaseIndex != -1) + { + packageVersion = packageVersion.Substring(0, prereleaseIndex); + } + Assert.StartsWith(packageVersion, model.GetProductVersion(), StringComparison.OrdinalIgnoreCase); }