Stripe API client for OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

stripe: Alcotest.failf (merlint E216)

+7 -7
+7 -7
test/test_stripe.ml
··· 39 39 Alcotest.(check string) 40 40 "event type" "customer.subscription.updated" event.event_type; 41 41 Alcotest.(check int) "created" 1735732800 event.created 42 - | Error e -> Alcotest.fail (Fmt.str "verification failed: %s" e) 42 + | Error e -> Alcotest.failf "verification failed: %s" e 43 43 44 44 (* Wrong secret should fail *) 45 45 let wrong_secret () = ··· 114 114 ~payload:sample_event_json ~signature:sig_header 115 115 with 116 116 | Ok event -> Alcotest.(check string) "event id" "evt_test_123" event.id 117 - | Error e -> Alcotest.fail (Fmt.str "should accept any valid v1: %s" e) 117 + | Error e -> Alcotest.failf "should accept any valid v1: %s" e 118 118 119 119 (* {1 JSON codec tests} *) 120 120 ··· 123 123 124 124 let customer_roundtrip () = 125 125 match Jsont_bytesrw.decode_string Stripe.Customer.jsont customer_json with 126 - | Error e -> Alcotest.fail (Fmt.str "decode: %s" e) 126 + | Error e -> Alcotest.failf "decode: %s" e 127 127 | Ok c -> 128 128 Alcotest.(check string) "id" "cus_test_123" c.id; 129 129 Alcotest.(check string) "email" "test@example.com" c.email; ··· 140 140 match 141 141 Jsont_bytesrw.decode_string Stripe.Subscription.jsont subscription_json 142 142 with 143 - | Error e -> Alcotest.fail (Fmt.str "decode: %s" e) 143 + | Error e -> Alcotest.failf "decode: %s" e 144 144 | Ok s -> 145 145 Alcotest.(check string) "id" "sub_test_456" s.id; 146 146 Alcotest.(check string) "customer" "cus_test_123" s.customer; ··· 152 152 153 153 let price_roundtrip () = 154 154 match Jsont_bytesrw.decode_string Stripe.Price.jsont price_json with 155 - | Error e -> Alcotest.fail (Fmt.str "decode: %s" e) 155 + | Error e -> Alcotest.failf "decode: %s" e 156 156 | Ok p -> ( 157 157 Alcotest.(check string) "id" "price_test_789" p.id; 158 158 Alcotest.(check string) "product" "prod_test_abc" p.product; ··· 169 169 170 170 let product_roundtrip () = 171 171 match Jsont_bytesrw.decode_string Stripe.Product.jsont product_json with 172 - | Error e -> Alcotest.fail (Fmt.str "decode: %s" e) 172 + | Error e -> Alcotest.failf "decode: %s" e 173 173 | Ok p -> 174 174 Alcotest.(check string) "id" "prod_test_abc" p.id; 175 175 Alcotest.(check string) "name" "SSA Pro" p.name; ··· 180 180 181 181 let checkout_roundtrip () = 182 182 match Jsont_bytesrw.decode_string Stripe.Checkout.jsont checkout_json with 183 - | Error e -> Alcotest.fail (Fmt.str "decode: %s" e) 183 + | Error e -> Alcotest.failf "decode: %s" e 184 184 | Ok c -> 185 185 Alcotest.(check string) "id" "cs_test_xyz" c.id; 186 186 Alcotest.(check bool) "has url" true (String.length c.url > 0);