mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
add cases
This commit is contained in:
parent
6f87f38789
commit
fba9d87ccd
@ -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 {
|
||||||
|
@ -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;
|
||||||
|
@ -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'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user