PageSourceSearch

https://mojolang.org/assets/js/5851bf99.b5b42ed8.js

js mojolang.org collected 2026-10-01 12:01:13 UTC 4,531 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmodular_fe=self.webpackChunkmodular_fe||[]).push([["15473"],{47533(e,s,t){t.r(s),t.d(s,{metadata:()=>n,default:()=>h,frontMatter:()=>o,contentTitle:()=>d,toc:()=>l,assets:()=>a});var n=JSON.parse('{"id":"docs/std/testing/testing/assert_is","title":"assert_is","description":"Asserts that the input values have the same identity. If they do not then an Error is raised.","source":"@site/versioned_docs/version-1.0.0/docs/std/testing/testing/assert_is.md","sourceDirName":"docs/std/testing/testing","slug":"/docs/std/testing/testing/assert_is","permalink":"/1.0.0/docs/std/testing/testing/assert_is","draft":false,"unlisted":false,"editUrl":"https://github.com/modular/modular/edit/main/Mojo/docs/site/std/testing/testing/assert_is.md","tags":[],"version":"1.0.0","frontMatter":{"title":"assert_is","version":"1.0.0.dev0","slug":"assert_is","type":"function","namespace":"std.testing.testing","lang":"mojo","show_stability_marker":null,"description":"Asserts that the input values have the same identity. If they do not then an Error is raised."},"sidebar":"stdSidebar","previous":{"title":"assert_false","permalink":"/1.0.0/docs/std/testing/testing/assert_false"},"next":{"title":"assert_is_not","permalink":"/1.0.0/docs/std/testing/testing/assert_is_not"}}'),i=t(74848),r=t(28453);let o={title:"assert_is",version:"1.0.0.dev0",slug:"assert_is",type:"function",namespace:"std.testing.testing",lang:"mojo",show_stability_marker:null,description:"Asserts that the input values have the same identity. If they do not then an Error is raised."},d,a={},l=[];function c(e){let s={a:"a",b:"b",code:"code",div:"div",li:"li",p:"p",section:"section",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(s.section,{className:"mojo-docs",children:["\n",(0,i.jsxs)(s.div,{className:"mojo-function-detail",children:["\n",(0,i.jsxs)(s.div,{className:"mojo-function-sig",children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.code,{children:'def assert_is[T: Identifiable & Writable, //](lhs: T, rhs: T, msg: String = "", *, location: Optional[SourceLocation] = None)'})}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"Asserts that the input values have the same identity. If they do not then an Error is raised."}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Parameters:"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\u200B",(0,i.jsx)(s.b,{children:"T"})," (",(0,i.jsx)(s.a,{href:"../../../../../docs/std/builtin/identifiable/Identifiable",children:(0,i.jsx)(s.code,{children:"Identifiable"})})," & ",(0,i.jsx)(s.a,{href:"../../../../../docs/std/format/Writable",children:(0,i.jsx)(s.code,{children:"Writable"})}),"): A Writable and Identifiable type."]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Args:"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\u200B",(0,i.jsx)(s.b,{children:"lhs"})," (",(0,i.jsx)(s.code,{children:"T"}),"): The lhs of the ",(0,i.jsx)(s.code,{children:"is"})," statement."]}),"\n",(0,i.jsxs)(s.li,{children:["\u200B",(0,i.jsx)(s.b,{children:"rhs"})," (",(0,i.jsx)(s.code,{children:"T"}),"): The rhs of the ",(0,i.jsx)(s.code,{children:"is"})," statement."]}),"\n",(0,i.jsxs)(s.li,{children:["\u200B",(0,i.jsx)(s.b,{children:"msg"})," (",(0,i.jsx)(s.a,{href:"../../../../../docs/std/collections/string/string/String",children:(0,i.jsx)(s.code,{children:"String"})}),"): The message to be printed if the assertion fails."]}),"\n",(0,i.jsxs)(s.li,{children:["\u200B",(0,i.jsx)(s.b,{children:"location"})," (",(0,i.jsx)(s.a,{href:"../../../../../docs/std/collections/optional/Optional",children:(0,i.jsx)(s.code,{children:"Optional[SourceLocation]"})}),"): The location of the error (defaults to ",(0,i.jsx)(s.code,{children:"call_location"}),")."]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Raises:"})}),"\n",(0,i.jsxs)(s.p,{children:["An Error with the provided message if assert fails and ",(0,i.jsx)(s.code,{children:"None"})," otherwise."]}),"\n"]}),"\n"]})}function h(e={}){let{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},28453(e,s,t){t.d(s,{R:()=>o,x:()=>d});var n=t(96540);let i={},r=n.createContext(i);function o(e){let s=n.useContext(r);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),n.createElement(r.Provider,{value:s},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.