File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,17 @@ let userModel1() = userModelByName "user-model-1"
1919
2020let userModel2 () = userModelByName " user-model-2"
2121
22- let expectError ( msg : string ) ( sql : string ) =
22+ let expectErrorWithModel ( mkMsg : Model -> string ) ( sql : string ) =
2323 let userModel = userModel1()
2424 try
2525 ignore <| CommandEffect.OfSQL( userModel.Model, " anonymous" , sql)
2626 failwith " Should've thrown an exception!"
2727 with
2828 | :? SourceException as exn ->
2929 printfn " \" %s \" " exn.Message
30- Assert.AreEqual( msg, exn.Reason.Trim())
30+ Assert.AreEqual( mkMsg userModel.Model, exn.Reason.Trim())
31+
32+ let expectError ( msg : string ) ( sql : string ) = expectErrorWithModel ( fun _ -> msg) sql
3133
3234let dispenserParameterIndexer () =
3335 let dict = Dictionary()
Original file line number Diff line number Diff line change @@ -45,4 +45,9 @@ let ``no such column to index on creation`` () =
4545[<Test>]
4646let ``can 't drop table referenced by others`` () =
4747 expectError ( Error.tableIsReferencedByFKs " main.Users" [ " main.UserGroupMaps" ])
48- " drop table Users"
48+ " drop table Users"
49+
50+ [<Test>]
51+ let ``non existing schema name`` () =
52+ expectErrorWithModel ( fun model -> Error.noSuchSchema model.Schemas " a" )
53+ " select * from a.b"
You can’t perform that action at this time.
0 commit comments