<commit_before>﻿namespace FSharp.Quotations.Compiler.Tests

[<TestModule>]
module ControlFlowExprTest =
  [<Test>]
  let ``try-with`` () =
    <@ try 10 with _e -> -1 @> |> check 10
    <@ try failwith "" with _e -> -1 @> |> check -1

  [<Test>]
  let ``try-finally`` () =
    <@ try 10 finally () @> |> check 10

  [<Test>]
  let ``try-with raise exception`` () =
    <@ try failwith "oops!" with e -> e.Message @>
    |> check "oops!"

  [<Test>]
  let ``sequential`` () =
    <@ (); 10 @> |> check 10<commit_msg>add test for try-with filter<commit_after>﻿namespace FSharp.Quotations.Compiler.Tests

[<TestModule>]
module ControlFlowExprTest =
  [<Test>]
  let ``try-with`` () =
    <@ try 10 with _e -> -1 @> |> check 10
    <@ try failwith "" with _e -> -1 @> |> check -1

  [<Test>]
  let ``try-with raise exception`` () =
    <@ try failwith "oops!" with e -> e.Message @>
    |> check "oops!"

  [<Test>]
  let ``try-with filter`` () =
    <@ try failwith "x" with e when e.Message = "x" -> "ok" | _ -> "ng" @>
    |> check "ok"
    <@ try failwith "y" with e when e.Message = "x" -> "ok" | _ -> "ng" @>
    |> check "ng"

  [<Test>]
  let ``try-finally`` () =
    <@ try 10 finally () @> |> check 10

  [<Test>]
  let ``sequential`` () =
    <@ (); 10 @> |> check 10
{'fraction_non_alphanumeric': 0.22213500784929358, 'fraction_numerical': 0.023547880690737835, 'mean_word_length': 2.642857142857143, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 48, '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': '1692252', 'n_tokens_mistral': 532, 'n_tokens_neox': 485, 'n_words': 129}