ATProto Personal Data Server storage for OCaml
4
fork

Configure Feed

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

fix(lint): use Fmt instead of Printf/Format in tests

Replace Printf.sprintf with Fmt.str, Format.asprintf with Fmt.str,
Format.fprintf with Fmt.pf, and Format.formatter_of_buffer patterns
with Fmt.str "%a" across all test files.

+4 -10
+4 -10
test/test_pds.ml
··· 10 10 let cwd = Eio.Stdenv.cwd env in 11 11 let tmp_dir = Eio.Path.(cwd / "_build" / "test_pds") in 12 12 (try Eio.Path.mkdirs ~exists_ok:true ~perm:0o755 tmp_dir with Eio.Io _ -> ()); 13 - let path = 14 - Eio.Path.(tmp_dir / Printf.sprintf "repo_%d" (Random.int 1_000_000)) 15 - in 13 + let path = Eio.Path.(tmp_dir / Fmt.str "repo_%d" (Random.int 1_000_000)) in 16 14 Eio.Switch.run @@ fun sw -> 17 15 let repo = Pds.v ~sw path ~did:test_did in 18 16 Fun.protect ~finally:(fun () -> Pds.close repo) (fun () -> f repo) ··· 24 22 let cwd = Eio.Stdenv.cwd env in 25 23 let tmp_dir = Eio.Path.(cwd / "_build" / "test_pds") in 26 24 (try Eio.Path.mkdirs ~exists_ok:true ~perm:0o755 tmp_dir with Eio.Io _ -> ()); 27 - let path = 28 - Eio.Path.(tmp_dir / Printf.sprintf "repo_%d" (Random.int 1_000_000)) 29 - in 25 + let path = Eio.Path.(tmp_dir / Fmt.str "repo_%d" (Random.int 1_000_000)) in 30 26 (* Create *) 31 27 Eio.Switch.run (fun sw -> 32 28 let repo = Pds.v ~sw path ~did:test_did in ··· 179 175 let car_data = 180 176 Eio.Switch.run @@ fun sw -> 181 177 let path = 182 - Eio.Path.(tmp_dir / Printf.sprintf "export_%d" (Random.int 1_000_000)) 178 + Eio.Path.(tmp_dir / Fmt.str "export_%d" (Random.int 1_000_000)) 183 179 in 184 180 let export_repo = Pds.v ~sw path ~did:test_did in 185 181 let data = Atp.Dagcbor.encode_string (`String "imported") in ··· 190 186 in 191 187 (* Import into a separate repo *) 192 188 Eio.Switch.run @@ fun sw -> 193 - let path = 194 - Eio.Path.(tmp_dir / Printf.sprintf "import_%d" (Random.int 1_000_000)) 195 - in 189 + let path = Eio.Path.(tmp_dir / Fmt.str "import_%d" (Random.int 1_000_000)) in 196 190 let repo = Pds.v ~sw path ~did:test_did in 197 191 let count = Pds.import_car repo car_data in 198 192 Pds.close repo;