add cases

This commit is contained in:
blueloveTH 2024-02-05 15:29:23 +08:00
parent 6f87f38789
commit fba9d87ccd
3 changed files with 5 additions and 5 deletions

View File

@ -98,7 +98,6 @@ struct StrName {
const char* c_str() const; const char* c_str() const;
bool empty() const { return index == 0; } bool empty() const { return index == 0; }
friend std::ostream& operator<<(std::ostream& os, const StrName& sn);
Str escape() const; Str escape() const;
bool operator==(const StrName& other) const noexcept { bool operator==(const StrName& other) const noexcept {

View File

@ -388,10 +388,6 @@ int utf8len(unsigned char c, bool suppress){
return cnt; return cnt;
} }
std::ostream& operator<<(std::ostream& os, const StrName& sn){
return os << sn.sv();
}
std::map<std::string, uint16_t, std::less<>>& StrName::_interned(){ std::map<std::string, uint16_t, std::less<>>& StrName::_interned(){
static std::map<std::string, uint16_t, std::less<>> interned; static std::map<std::string, uint16_t, std::less<>> interned;
return interned; return interned;

View File

@ -180,3 +180,8 @@ assert list(a) == ['测']
assert '\b\b\b' == '\x08\x08\x08' assert '\b\b\b' == '\x08\x08\x08'
stack=[1,2,3,4]; assert f"{stack[2:]}" == '[3, 4]' stack=[1,2,3,4]; assert f"{stack[2:]}" == '[3, 4]'
assert repr('\x1f\x1e\x1f') == '\'\\x1f\\x1e\\x1f\''
assert hex(255) == '0xFF'
assert hex(-42) == '-0x2A'