<commit_before>package eu.timepit.refined

import eu.timepit.refined.numeric.Positive
import org.scalacheck.Prop._
import org.scalacheck.Properties
import shapeless.tag.@@
import shapeless.test.illTyped

class RefineSyntaxSpec extends Properties("refine syntax") {

  def testRefine(arg: Either[String, Int @@ Positive]): Boolean = true
  def testRefineMT(arg: Int @@ Positive): Boolean = true

  property("refine success") = secure {
    testRefine(refineT(1))
    testRefine(refineT[Positive](1))
    testRefine(refineT[Positive][Int](1))
  }

  property("refine failure") = secure {
    testRefine(refineT(-1))
    testRefine(refineT[Positive](-1))
    testRefine(refineT[Positive][Int](-1))
  }

  property("refineMT success") = secure {
    testRefineMT(refineMT(1))
    testRefineMT(refineMT[Positive](1))
    testRefineMT(refineMT[Positive][Int](1))
  }

  property("refineMT failure") = secure {
    illTyped("testRefineMT(refineMT(-1))", "could not find implicit value.*")
    illTyped("testRefineMT(refineMT[Positive](-1))", "Predicate.*fail.*")
    illTyped("testRefineMT(refineMT[Positive][Int](-1))", "Predicate.*fail.*")
    true
  }
}
<commit_msg>Test refineMV with a type alias<commit_after>package eu.timepit.refined

import eu.timepit.refined.implicits._
import eu.timepit.refined.numeric.Positive
import org.scalacheck.Prop._
import org.scalacheck.Properties
import shapeless.tag.@@
import shapeless.test.illTyped

class RefineSyntaxSpec extends Properties("refine syntax") {

  def testRefine(arg: Either[String, Int @@ Positive]): Boolean = true
  def testRefineMT(arg: Int @@ Positive): Boolean = true

  property("refine success") = secure {
    testRefine(refineT(1))
    testRefine(refineT[Positive](1))
    testRefine(refineT[Positive][Int](1))
  }

  property("refine failure") = secure {
    testRefine(refineT(-1))
    testRefine(refineT[Positive](-1))
    testRefine(refineT[Positive][Int](-1))
  }

  property("refineMT success") = secure {
    testRefineMT(refineMT(1))
    testRefineMT(refineMT[Positive](1))
    testRefineMT(refineMT[Positive][Int](1))
  }

  property("refineMT failure") = secure {
    illTyped("testRefineMT(refineMT(-1))", "could not find implicit value.*")
    illTyped("testRefineMT(refineMT[Positive](-1))", "Predicate.*fail.*")
    illTyped("testRefineMT(refineMT[Positive][Int](-1))", "Predicate.*fail.*")
    true
  }

  property("refineMV with type alias") = secure {
    type PositiveInt = Int Refined Positive

    val x: PositiveInt = refineMV(5)
    val y: PositiveInt = 5
    illTyped("val z: PositiveInt = -5", "Predicate failed: \\(-5 > 0\\).*")
    x == y
  }
}

{'fraction_non_alphanumeric': 0.1524135309768149, 'fraction_numerical': 0.011022424933485367, 'mean_word_length': 4.823008849557522, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6742949', 'n_tokens_mistral': 947, 'n_tokens_neox': 903, 'n_words': 159}